* @author Eoghan Murray * @license Statcounter License * @link http://www.statcounter.com */ require_once "../global.php.inc"; $filename = "."; require_once "$includeFolder/presentation/page.php"; require_once "$includeFolder/presentation/GlobalStatsResponsivePage.php"; require_once "$includeFolder/presentation/side.php"; require_once "$includeFolder/presentation/dateselector.php"; require_once "index.php.inc"; require_once "$includeFolder/database/GlobalStatsDatabase.php"; require_once "./SnapshotTitle.php"; // !This check is also in about.php and chart.php.inc $development = $_SERVER['HTTP_HOST'] != 'gs.statcounter.com' && $_SERVER['HTTP_HOST'] != 'gsa.statcounter.com' && $_SERVER['HTTP_HOST'] != 'gsb.statcounter.com'; $test_dev = false; if(!$development){ $img_pp = 'https://www.statcounter.com'; $baseLink = $httpRootCurrent; } else { $img_pp = ''; $baseLink = $httpRootCurrent."/global-stats"; } $title = "Statcounter Global Stats - Browser, OS, Search Engine including Mobile Usage Share"; $description = 'Tracks the Usage Share of Search Engines, Browsers and Operating Systems including Mobile from over '.$globalStatCounterMonthlyPageViewsTracked.' monthly page views.'; $keywords = "global stats, browser, version, mobile, free, os, operating, system, systems, browsers, market, share, usage share, global, stats"; $dselect->granularity = 'all'; $dselect->latestEntry = $latestEntry; $dselect->oldestEntry = $oldestEntry; $middle = ''; // in case debugging is enabled, highlight it on the screen if(isset($partitionServer) && $partitionServer!="") { $middle .= "Data source: $partitionServer
"; } $middle .= ''; $middle .= ''; $middle .= ''; $middle .= ''; $cia_msg = 'Warning: Please read our disclaimer
Weighted based on 2009-2011 CIA figures'; $middle .= '
'.$cia_msg.'
'.$cia_msg.'
Partially Combined: more info
'; $chartDivs = '
'; $chartDivs .= '
Sorry, JavaScript is required to view Global Stats charts.
'; // clear the Javascript required text asap $chartDivs .= ''; $middle .= $chartDivs; if (isGlobalStatsPro()) { $middle .= '
'; } else { $middle .= '
'; } $middle .= '
'; // map line uncomment $middle .= ' '; $device_enabled_class = ' device-enabled'; $middle .= '
Browser
'; $premium_filters = array('browser' => 'Browser', 'browser_version' => 'Browser Version', 'os' => 'Operating System', 'width' => 'Screen Width', 'height' => 'Screen Height', 'search_engine'=>'Search Engine', 'engine_host'=>'Search Engine Host', 'vendor'=>'Device Vendor', 'model'=>'Device Model', 'social_network_id'=>'Socal Media'); if (isGlobalStatsPro()) { $chosen_ui = true; $middle .= '
'; forEach($premium_filters as $dd_key => $dd_desc) { $middle .= '
'; $middle .= ''; if (in_array($dd_key, array('width', 'height'))) { $middle .= ''; $middle .= ''; $middle .= '
'; } else if ($chosen_ui) { $middle .= ''; } else { $middle .= ' '; } $middle .= '
'; } $middle .= '
'; $middle .= '
'; } $middle .= '
'; $middle .= '

'; $popup_window = ''; $popup_window .= $dselect->drawWindow($filename, true); $popup_window .= $dselect->rGlobalStatsSelector(); if (isset($_GET['show_premium'])) { $middle .= '
'; } else { $middle .= '
'; } $middle .= '

Save Graph Image

.png format

Download Data

.csv spreadsheet

Embed HTML:

'; if (isset($_GET['show_premium'])) { $middle .= ' '; if (isGlobalStatsPro()) { $middle .= '
 
'; } $middle .= '

Filter Data

Premium Upgrade
'; } $middle .= '
'; if (!$showNewGsDesign) { $middle .= '

Customize

  • Select a statistic (e.g. search engine)
  • Choose a region/country
  • Pick a time period & view your graph

Recent Global Stats News Items

    '; $storyCount=0; foreach($pressReleaseArray as $name => $value) { $storyCount++; if ($storyCount<=3) { $middle .= '
  1. '.substr($value['pubDate'], 0, 16).'
    '.$value['title'].'
  2. '; } } $middle .= '

Keep Updated

RSS Feed Subscribe to our Global Stats News Feed

Twitter Icon Follow Global Stats on Twitter

Join our mailing list to receive news items by email.

Learn

  • Identify search engine usage trends
  • Get usage share stats for mobile browsers
  • Find the most popular operating systems
'; } // temporarily remove pop up text,to stop appearing in search engines /*$popup_window .= '
     

Upgrade to Premium Global Stats!

Analyse trends in the OS, Browser and Mobile landscape and be first to publish changes in the market.

Unlock the following in-depth filters:

    '; forEach($premium_filters as $dd_key => $dd_desc) { $popup_window .= '
  • '.$dd_desc.'
  • '; } $popup_window .= '

In-depth filtering is available on Global Stats since October 2013. Premium upgrades cost €99 per month.

Email premium@gs.statcounter.com to find out more!
';*/ if ($showNewGsDesign){ $region = " Worldwide"; $device = ""; $stat = " Browser"; $path = strtok($_SERVER["REQUEST_URI"],'?'); // remove any query string $path = str_replace("/global-stats/", "", $path); $rawPathElements = explode("/",$path); $pathElements = array(); foreach($rawPathElements as $pathElement){ if($pathElement != ''){ $pathElements[] = $pathElement; } } // merge os-version-market-share/windows into os-windows-versions if(count( (array) $pathElements) > 1){ if($pathElements[0] == 'os-version-market-share' && $pathElements[1] == 'windows'){ $pathElements[0] = 'windows-version-market-share'; array_splice ($pathElements , 1,1); } else if ($pathElements[0] == 'os-version-market-share' && $pathElements[1] == 'macos') { $pathElements[0] = 'macos-version-market-share'; array_splice ($pathElements , 1,1); } else if ($pathElements[0] == 'os-version-market-share' && $pathElements[1] == 'ios') { $pathElements[0] = 'ios-version-market-share'; array_splice ($pathElements , 1,1); } else if ($pathElements[0] == 'os-version-market-share' && $pathElements[1] == 'android') { $pathElements[0] = 'android-version-market-share'; array_splice ($pathElements , 1,1); } } // if we're looking at platform market share and no device is specified, hardcode in the default desktop-mobile-tablet if(count( (array) $pathElements) == 1 && $pathElements[0] == 'platform-market-share'){ $pathElements[] = 'desktop-mobile-tablet-console'; } $validStats = array('search-engine-host-','search-engine-', 'os-', 'social-media-', 'vendor-', 'browser-version-partially-combined-', 'browser-version-', 'browser-', 'screen-resolution-','comparison-', 'windows-version-', 'macos-version-', 'ios-version-', 'android-version-'); //$validStats = array('search-engine-host-','search-engine-', 'os-', 'social-media-', 'vendor-', 'browser-version-partially-combined-', 'browser-version-', 'browser-', 'screen-resolution-','comparison-', 'os-windows-versions-'); if(count( (array) $pathElements) > 0){ if($pathElements[0] == 'social-media-stats'){ $s = 'social-media-'; } else if ($pathElements[0] == 'screen-resolution-stats'){ $s = 'screen-resolution-'; } else if ($pathElements[0] == 'platform-market-share'){ $s = 'comparison-'; } else { $s = str_replace("market-share", "", $pathElements[0]); } if(!in_array($s, $validStats)){ $pathElements = array(); } } $top = ''; $market_share_string = ''; $deviceArray = array(); if(count( (array) $pathElements) > 0){ // url + hash if(count( (array) $pathElements) > 1){ $deviceArray = explode('-',$pathElements[1]); $device = ' '.ucfirst($pathElements[1]); $device = explode('-',$device); if(count( (array) $device) == 1){ $device = $device[0]; } else { $devicesLength = count((array) $device); $result = ''; $i = 0; foreach($device as $d){ if($i == 0){ $result .= $d; } else if($i == $devicesLength-1){ $result .= ' & '.$d; } else { $result .= ', '.$d; } $i++; } $device = $result; } $device = ucwords($device); } if($pathElements[0] == 'social-media-stats'){ $stat = 'social-media-'; } else if ($pathElements[0] == 'screen-resolution-stats'){ $stat = 'screen-resolution-'; } else if ($pathElements[0] == 'platform-market-share'){ $stat = 'comparison-'; } else { $stat = str_replace("market-share", "", $pathElements[0]); } if(!in_array($stat, $validStats)){ $stat = 'browser-'; } $statReplacements = array(); $statReplacements['search-engine-host-'] = 'search engine host'; $statReplacements['search-engine-'] = 'search engine'; $statReplacements['windows-version-'] = 'windows version'; $statReplacements['macos-version-'] = 'macos version'; $statReplacements['ios-version-'] = 'ios version'; $statReplacements['android-version-'] = 'android version'; $statReplacements['os-'] = 'operating system'; $statReplacements['social-media-'] = 'social media'; $statReplacements['vendor-'] = 'vendor'; $statReplacements['browser-version-partially-combined-'] = 'browser version (Partially combined)'; $statReplacements['browser-version-'] = 'browser version'; $statReplacements['browser-'] = 'browser'; $statReplacements['screen-resolution-'] = 'screen resolution'; $statReplacements['comparison-'] = 'comparison'; $statReplacements['platform-'] = 'comparison'; foreach($statReplacements as $id=>$friendly) { $stat = str_replace($id, $friendly, $stat); } if($stat == 'comparison'){ $top = ''; } $stat = ' '.ucwords($stat); if(count( (array) $pathElements) > 2){ $region = str_replace('-', ' ', $pathElements[2]); $region = ' '.ucwords($region); } } else { // hash only } $global_stats = array(); $statToStatTypeKey = array(); $statToStatTypeKey[' Browser'] = 'browser'; $statToStatTypeKey[' Search Engine'] = 'search_engine'; $statToStatTypeKey[' Operating System'] = 'os_combined'; $statToStatTypeKey[' Screen Resolution'] = 'resolution'; $statToStatTypeKey[' Social Media'] = 'social_media'; $statToStatTypeKey[' Vendor'] = 'vendor'; $statToStatTypeKey[' Comparison'] = 'comparison'; $statToStatTypeKey[' Browser Version'] = 'browser_version'; $statToStatTypeKey[' Search Engine Host'] = 'search_engine_host'; $statToStatTypeKey[' Windows Version'] = 'windows_version'; $statToStatTypeKey[' Macos Version'] = 'macos_version'; $statToStatTypeKey[' Ios Version'] = 'ios_version'; $statToStatTypeKey[' Android Version'] = 'android_version'; // if we're on the landing page of one of the 9 root shortcuts, retrieve snapshot data for the last month for that stat to show in the header $comparisonLandingPage = count((array) $pathElements) == 2 && $pathElements[0] == 'platform-market-share' && $pathElements[1] == 'desktop-mobile-tablet'; $vendorLandingPage = count((array) $pathElements) == 2 && $pathElements[0] == 'vendor-market-share' && $pathElements[1] == 'mobile'; $windowsVersionLandingPage = count((array) $pathElements) == 3 && $pathElements[0] == 'windows-version-market-share' && $pathElements[1] == 'desktop' && $pathElements[2] == 'worldwide'; $macOsVersionLandingPage = count((array) $pathElements) == 3 && $pathElements[0] == 'macos-version-market-share' && $pathElements[1] == 'desktop' && $pathElements[2] == 'worldwide'; $iOsVersionLandingPage = count((array) $pathElements) == 3 && $pathElements[0] == 'ios-version-market-share' && $pathElements[1] == 'mobile-tablet' && $pathElements[2] == 'worldwide'; $androidVersionLandingPage = count((array) $pathElements) == 3 && $pathElements[0] == 'android-version-market-share' && $pathElements[1] == 'mobile-tablet' && $pathElements[2] == 'worldwide'; $onStatLandingPage = count((array) $pathElements) == 1 || $comparisonLandingPage || $vendorLandingPage || $windowsVersionLandingPage || $macOsVersionLandingPage || $iOsVersionLandingPage || $androidVersionLandingPage; $onHomePage = count((array) $pathElements) == 0; $twitterCardImage = 'https://gs.statcounter.com/images/og_image_gs.jpg'; $page = new GlobalStatsResponsivePage(); $regionOrig = str_replace(' ','-',strtolower(trim($region))); if($regionOrig == ''){ $regionOrig = 'worldwide'; } if(array_key_exists($stat, $statToStatTypeKey) && array_key_exists($regionOrig, $page->regionNamesToGSCodes)){ $statTypeKey = $statToStatTypeKey[$stat]; $device_arr = $deviceArray; if(count( (array) $device_arr) == 0 || $device_arr[0] == 'all'){ $device_arr = array('desktop', 'mobile', 'tablet', 'console'); } $year = date("Y", strtotime("first day of previous month")); $month = date("m", strtotime("first day of previous month")); $gsRegionCode = $page->regionNamesToGSCodes[$regionOrig]; $global_stats = $dGlobalStatsSlave->selectSnapshotData($statTypeKey, $device_arr, $month, $year, $gsRegionCode); // var_dump('Globals_Stats->selectSnapShopData: ', $global_stats, $statTypeKey); if(count( (array) $global_stats) > 0){ $twitterCardImage = 'https://statcounter.com/gs_snapshots/'.$statTypeKey.'-'.$month.'-'.$year.'-'.implode("_", $device_arr).'-'.$gsRegionCode.'.png'; } } // end of snapshot data retrieval if(trim($region) != 'Ww' && trim($region) != 'Worldwide'){ $region = 'in'.$region; } if($device == ' All'){ $device = ''; if($stat == ' Comparison'){ $device = 'Desktop & Mobile & Tablet & Console'; } } if($stat == ' Comparison'){ $device = str_replace("&", "vs", $device); $device = str_replace(", ", " vs ", $device); } $metric = ' Market Share '; if($stat == ' Screen Resolution' || $stat == ' Social Media'){ $metric = ' Stats '; } /** * chartRange is being over written with empty string - don't think the above is used anymore (see closing comment) */ $year = ""; $chartRange = ""; $validYears = []; $firstYear = 2006; for ($i=$firstYear; $i < gmdate('Y'); $i++) { $validYears[] = $i; } if(count( (array) $pathElements) > 3 && in_array($pathElements[3], $validYears)){ $year = $pathElements[3]; $chartRange = "Jan $year to Dec $year"; } /** * chartRange is being over written with empty string - don't think the above is used anymore */ $chart_warning = ''; if (count((array) $pathElements) > 1 &&$pathElements[0] == 'macos-version-market-share' && $pathElements[1] == 'desktop') { $apple_version_message = sprintf(_('Apple are incorrectly reporting all macOS releases since Catalina 10.15 as Catalina 10.15. You can read more about it here.'), 'https://bugs.webkit.org/show_bug.cgi?id=216593') . "
"; $apple_version_message .= _('We can\'t correctly show usage for Catalina 10.15, Big Sur 11, Monterey 12, Ventura 13 or Sonoma 14 until Apple fixes this.'); $chart_warning = to_message('warning', $apple_version_message); } // remove Comparison from the title $statTitle = $stat; if($statTitle == ' Comparison'){ $statTitle = ' '; } $snapshotTitleObj = new SnapshotTitle($device, $statTitle, $metric, $region); $titleElements = $snapshotTitleObj->returnTitleElementsArray(); $chartTitle = $snapshotTitleObj->getChartTitle(); $snapshotTitle = $snapshotTitleObj->getSnapshotTitle(); $pageTitle = $chartTitle; $market_share_string = strtolower($device.$stat).' market share'; $chartRange = ''; $statDescription = "Browsers"; // Set a different meta description outside the homepage if(count( (array) $pathElements) > 0){ $statDescription = strtolower($stat); // pluralise except for social media if(trim($statDescription) != 'social media'){ $statDescription .= 's'; } // desktop vs tablet vs mobile comparisons should be just desktop vs tablet vs mobile if(trim($statDescription) == 'comparisons'){ $statDescription = ''; } // note the 'based on over' is an important keyword for use in the javascript // everything after 'based on over' is removed in the javascript meta description update $description = 'This graph shows the '.strtolower($metric).' of'.strtolower($device).$statDescription.' '.$region.' based on over '.$globalStatCounterMonthlyPageViewsTracked.' monthly page views.'; // regularise spacing - might be some double spaces $descriptionElements = preg_split('/\s+/', $description); $description = implode(' ', $descriptionElements); // replace capitalised Worldwide with just worldwide $description = str_replace("Worldwide", "worldwide", $description); } //session_start(); // if we're showing the homepage, with no url path parameters, default to the old page title $defaultPageTitle = "Statcounter Global Stats - Browser, OS, Search Engine including Mobile Usage Share"; if(count( (array) $pathElements) == 0){ $title = $defaultPageTitle; } else { $title = "$pageTitle | Statcounter Global Stats"; } $cardType = 'summary'; if($twitterCardImage != 'http://gs.statcounter.com/images/og_image_gs.jpg'){ $cardType = 'summary_large_image'; // use the twitter card image for the other open graph social networks too $page->setOpenGraphImage($twitterCardImage); } $twitterMetaProperties = ' '; $page->setAdditionalMetaProperties($twitterMetaProperties); $chartTypeControls = '
  • '; // map line uncomment $chartTypeControls .= '
'; $bodyClass = ''; $stats_snapshot = ''; if (count( (array) $global_stats) > 0) { // regularise spacing - might be some double spaces $snapshotHeader = ($device).$statDescription; $snapshotHeaderElements = preg_split('/\s+/', $snapshotHeader); $snapshotHeader = implode(' ', $snapshotHeaderElements); $snapshotHeader = ucwords(ltrim($snapshotHeader)); $stats_snapshot = $page->getSnapshotTable($global_stats, $snapshotHeader, $snapshotTitle); $bodyClass = 'snapshot-header'; } $chartHtml = ''; $chartHtml .= ''; $chartHtml .= ''; $chartHtml .= ''; $chartHtml .='
'.$stats_snapshot.'
'; $chartHtml .='
'. $chart_warning .'

'.$chartTitle.'

'.$chartRange.'

Edit Chart Data
'.$chartDivs.'

Source: Statcounter Global Stats - Browser Market Share

\'>
'; $jsFiles = ''; global $js_versions, $cdnDomain, $isSecure; if ($isDevServer || isset($_GET['production'])) { $cdnLink = ''; // Use dev server versions of css/js files (even when simulating production as need to use local versions of packed files) } else if ($isSecure) { $cdnLink = 'https://'.$cdnDomain; } else { $cdnLink = 'http://'.$cdnDomain; } // pass the default page title through to JS for use in gs_2017 $jsFiles = ''; $jsFiles .=' '; $jsFiles .= ' '; $page->setFirstJsFiles($jsFiles); if ($isDevServer || isset($_GET['production'])) { $page->addJavascriptFile('/global-stats/js/gs_movePlatformList-inline.jquery.js'); } else { $page->addJavascriptFile('/js/gs_movePlatformList-inline.jquery.js'); } $middle = '
'; $middle .= $chartHtml; $middle .= '
'; $shortcuts = $page->getShortcuts($pathElements, $market_share_string); $middle .= $shortcuts; $middle .= '
'; $page->setTitle($title); $page->setDescription($description); $page->setKeywords($keywords); $page->setExcludeFeedbackTab(true); $page->setColumnLayout(SINGLE_COLUMN_WIDE); $page->setBannerHeadline('GlobalStats'); $page->setBannerSubheadline(''); $page->setBodyId('section-home'); $page->setBodyClass($bodyClass); $page->setColumnContent(COLUMN_ONE, $middle); $page->addBottomBanner($page->getNewsletterBanner()); $page->addBottomBanner($page->getCreateAccountBanner()); print $page->rPage(); } else { $page = new Page($filename, true, null, null, $title, $description, $keywords, "", 'API'); $page->baseHref = $baseLink; $page->sLogo(''); $stats_no_cache = ''; if ($isDevServer) { $stats_no_cache = '-'.filemtime('/home/statcounter/www/js/global-stats.mochikit.js'); } $premium_head = ''; if (isGlobalStatsPro()) { if ($isDevServer || isset($_GET['production'])) { $cdnLink = ''; // Use dev server versions of css/js files (even when simulating production as need to use local versions of packed files) } else if($page->isSecure()) { $cdnLink = 'https://'.$cdnDomain; } else { $cdnLink = 'http://'.$cdnDomain; } $premium_head = ' '; } $page->sHead(' ' . $premium_head); $page->navigationArray = array(array(_("Main"),"."), array(_("Press"), "press"), array(_("FAQ"),"faq"), array(_("About"),"about"), array(_("Feedback"),"feedback")); $page->sMiddleFull($middle, $popup_window); $page->sFooterScript(''); print $page->rPage(); } ?>