Discrepancy between API and web interface data (with same query).

1,775 views
Skip to first unread message

Georgina @ Quirk

unread,
Aug 3, 2012, 3:18:28 AM8/3/12
to google-analytics...@googlegroups.com
This issue has now appeared twice across completely different clients. I am including the most recent example below:

Google Analytics Core Reporting API returns 291,437 visits versus GA site, which shows 293,527 visits
  • Segment: Non-paid search traffic (gaid -5)
  • Dimensions: Nth Month - look at July 2012 result
  • Metrics: Visits, Visitors, Pageviews, Visit bounce rate, percent new visits

However please note:
The API and the Web interface match on Total Visits (536,580) for the same month, same profile.

Questions:

  • Which figure is correct? The API or the web interface?
  • Is this a normal discrepancy?
  • Is the API broken or can we control for this?
  • How do we control for this?

Context: we are developing a piece of software that pulls data using the core reporting API. If the API is unreliable / persistently inaccurate, we will cancel this project as we do not want to spend the resources to build around inaccurate data.

In this example, the difference is not very significant, however in our other example the API reported 1046 organic visits in a month, while the web interface reported 1344 organic visits on the same profile in the same month. That is significant!

Craig Armstead

unread,
Aug 3, 2012, 4:04:03 AM8/3/12
to google-analytics...@googlegroups.com
Georgina,

I can confirm what you are saying here.  However what I have discovered just yesterday was that the numbers change depending on what time frame you extract the data from.

For example.  If I extract data from 01-01-2011 to 02-08-2012 and look at data for 02-08-2012 I get 799 Visits for Direct Traffic.
But if I then extract just this years data 01-01-2012 to 02-08-2012 I get 807 visits for the same metric!

Having checked the other days they are all different!

If I run the same report in the GA web interface I get 807.  So I am also confused as to which is correct.

Come on Google get this fixed please.

Craig Armstead

unread,
Aug 3, 2012, 4:21:19 AM8/3/12
to google-analytics...@googlegroups.com
OK I have just ran the Query Explorer Tool and get the same problem!
So it's got nothing to do with my code and it's definitely an issue with the API.

Cheers
Craig

Craig Armstead

unread,
Aug 3, 2012, 4:21:20 AM8/3/12
to google-analytics...@googlegroups.com

Craig Armstead

unread,
Aug 3, 2012, 5:01:47 AM8/3/12
to google-analytics...@googlegroups.com
OK the problem gets worse!

Having ran the reports to compare against GA web interface where the date range problem lies I discovered that even the GA web interface results change for the same day!

So from GA web interface :-
01/08/2011 to 02/08/2012 for 02/08/2012 I get 798 for direct traffic 
01/09/2011 to 02/08/2012 for 02/08/2012 I get 793
01/01/2012 to 02/08/2012 for 02/08/2012 I get 796
01/02/2012 to 02/08/2012 for 02/08/2012 I get 802
01/03/2012 to 02/08/2012 for 02/08/2012 I get 807
each month onward I get 807!   

From API :-
01/08/2011 to 02/08/2012 for 02/08/2012 I get 807
01/09/2011 to 02/08/2012 for 02/08/2012 I get 807
01/01/2012 to 02/08/2012 for 02/08/2012 I get 807
01/02/2012 to 02/08/2012 for 02/08/2012 I get 807
01/03/2012 to 02/08/2012 for 02/08/2012 I get 807
each month onward I get 807!

What is going on, which figures are correct?
Message has been deleted

Nick

unread,
Aug 3, 2012, 4:18:51 PM8/3/12
to google-analytics...@googlegroups.com
So,

As it turns out, regardless of whether you access your data from the UI or the API, the query goes to the same infrastructure to return the reports.

So a common issue is that the query you think you are replicating with the API is really a lot different than what is actually being sent from the UI. Generally if you try to use custom reports in GA, you will see the exact same data as the UI.

As for why the same number appears in all the dates, it looks like some bug. You might want to check your code or the tool that you're using.

-Nick

Karl Geiger

unread,
Mar 7, 2014, 4:50:56 AM3/7/14
to google-analytics...@googlegroups.com
Hi Nick, 

we're querying visits per day from the core API for a number of our properties. Looking at the output, we find a (small) discrepancy between the visits as reported by the API and those as reported by the web interface, exactly as described above. 

The API queries are very simple: visits on (e.g.) Feb 02, 2014. Next query: visits on Feb 03, 2014. etc. 

Nevertheless, the numbers as reported by the core API are not the same as those reported in the web interface. 

Even stranger, they are the same after February 19, and divergent only on days before February 18, for some of our properties. For others, they're the same regardless of date; for yet others, they diverge on every single day. 

We need to be able to trust the data - so which system is more trustworthy, the web or the API? 

Kind regards, 
Karl Geiger 

Pete

unread,
Mar 10, 2014, 11:53:23 AM3/10/14
to google-analytics...@googlegroups.com
I think Nick's response covered this: "As it turns out, regardless of whether you access your data from the UI or the API, the query goes to the same infrastructure to return the reports."

Perhaps you could include some additional info like which report you're looking at in the web interface and the actual API queries you're making. Also, as Nick suggested if you use a custom report in the UI is it still different?
Reply all
Reply to author
Forward
0 new messages