Differences between Interface and API

457 views
Skip to first unread message

Gerron Mulder

unread,
Jul 6, 2011, 6:11:31 AM7/6/11
to google-analytics...@googlegroups.com
I am not able to get the same results via the API as like within the Interface. What can I do to get there? Might this have to do with different time zones?

The interface allows you to select 2 time zones. Your own, and of your visitors. Does the Interface somehow convert?

Interface: link

API: link

Gerron Mulder

unread,
Jul 6, 2011, 6:17:01 AM7/6/11
to google-analytics...@googlegroups.com
I just read that the Interfaces swaps to the Google Adwords time zone if connected?

Nick

unread,
Jul 8, 2011, 3:26:56 PM7/8/11
to google-analytics...@googlegroups.com
Hi,

This is a good question. The main reason why your data is different is that the underlying queries issuing the requests in both interfaces are different.

The UI and API both use a common gateway to access 1 version of your data. But the way you issue requests to that gateway can make the data very. You can see this by forming the same API query via custom reports and seeing that the data is different.

In short, the UI screenshot is getting data from pre-calculated tables. And the API query is going back to the raw hits / sessions data and recalculating the data on the fly. There is sometimes a slight delay between collecting raw data and when it appears in the pre-calculated tables...and why you see a slight difference.

-Nick

Gerron Mulder

unread,
Jul 11, 2011, 12:55:09 PM7/11/11
to google-analytics...@googlegroups.com
Hi Nick,

That clarifies a lot.

So on large data sets they will never come together?

A 0,5% delta would already mean a 500k <-> 1M delta on our total numbers (entire network). Which is a lot.

Which one would be more reliable?

Thanks,
Gerron

Nick

unread,
Jul 12, 2011, 5:22:52 PM7/12/11
to google-analytics...@googlegroups.com
They will come together if you query the data just after the pre-calculated data has been completed.

One option is that creating a segment always required GA to go and hit the raw data. So you might consider creating a segment which matches all visits (Sessions) so you only pull data non-pre-calculated data.

-Nick

Joris W

unread,
Sep 5, 2011, 8:49:38 AM9/5/11
to google-analytics...@googlegroups.com
Nick,

Does your story about precalculated data also affect dates a few weeks in the past?

If I grab data today for 2011-08-20, let's say I pull Visits separately for a particular value of customVariable2, the Visits are listed ~3000 by the API while they are ~3800 on the Analytics website.

Nick

unread,
Sep 5, 2011, 5:43:17 PM9/5/11
to google-analytics...@googlegroups.com
It's hard to tell whats going on. It would depend on what query you are issuing.

But the fact is the same data and calculations are happening between UI and API, the main missing piece is what queries the UI is issuing to fill the reports, so you can duplicate via the API.

-Nick
Reply all
Reply to author
Forward
0 new messages