Mismatch for number of keywords between API and web interface

48 views
Skip to first unread message

Stefan

unread,
Jan 30, 2013, 4:18:16 AM1/30/13
to google-analytics...@googlegroups.com
Hi

I'm tring to get the number of organic keywords used in a given timeframe, but I get 2 more results from the API call than from the Google Analytics web interface.

I have identified the two extra keywords I get from the API call and they are not included in the report I get in the Google Analytics web interface.

This is my function to get the data from the API in PHP:

function GetNumberOfOrganicKeywords(&$analytics, $profileID, $startDate, $endDate) {
  $optParams = array(
      'dimensions' => 'ga:keyword',
      'metrics' =>     'ga:visits',
      'filters' => 'ga:medium==organic',
      'sort' =>    '-ga:visits',
      'max-results' => '500');
                 
      return $analytics->data_ga->get(
     'ga:' . $profileID,
      $startDate,
      $endDate,
      'ga:visits',
      $optParams);
}

selfLink: https://www.googleapis.com/analytics/v3/data/ga?ids=ga:XXXXXXX&dimensions=ga:keyword&metrics=ga:visits&sort=-ga:visits&filters=ga:medium%3D%3Dorganic&start-date=2012-12-30&end-date=2013-01-05&max-results=500

This gives me 459 keywords from the given date range while requesting Google Analytics API, but only 457 keywords when I choose the same dates in Google Analytics web interface?

One of the keywords I get from the API but not from the
Google Analytics web interface contains a "%" symbol, does the web interface have problems showing special charachters like this? The other extra keyword i get does not contain any special symbols...

Any suggestions for this mismatch?


Reply all
Reply to author
Forward
0 new messages