0
votes

I am trying to get unique page (ga:users ?) views through Google API, but there is some inconstistency with returned number and number, that I see in Google Analytics web interface.

Actually, the number returned by API is every time smaller by few visits. For example, in GA web interface I see 39 unique visit for certain URL, but API returns me 37.

Which one is right and why is there difference?

For normal (non-unique) page views I don't see this problem - numbers are same.

I am using PHP and this is the responsible piece of code

$a = $Google_AnalyticsService->data_ga->get(
   MY_TABLE_ID,
   '2014-06-02',
   '2014-06-02',
   'ga:pageViews, ga:users',
   array('filters' => 'ga:pagePath==/my-url')
);

however, when I debug it using http://ga-dev-tools.appspot.com/explorer/ , results are still not consistent

1

1 Answers

1
votes

The issue is that you are mixing various metrics. To make it clear:

  • ga:users = Users in web interface, represent number of unique users.
  • ga:pageviews = Pageviews in web interfrace, number of pageviews.
  • ga: uniquePageviews = Unique Pageviews in web interface. The number of different (unique) pages within a session.

If you use Unique Pageviews metric in regard to specific pages, then it actually means Visits (recently renamed to Sessions in GA web interface). It tells you how many visits included (1 or more) pageview of that page. A bit more detailed explanation can be found in GA Help Documentation.

Hope this helps :)