Setting timezone on GA API calls?

4,279 views
Skip to first unread message

Nick Jones

unread,
Aug 11, 2010, 8:50:02 AM8/11/10
to google-analytics-api - GA Data Export API
I'm getting differing values from the web interface and API
respectively and it appears to be due to timezones.

Is there any way to SET the timezone in the API call itself?

I can't find any documentation that supports this option and adding
&ga:timezone==GMT to the query string doesn't appear to work.

All requests come back with timestamps of PST (GMT-7). This seems
ludicrous to me, why is default not UTC?

Any help would be gratefully received!

Thanks.

Nick

unread,
Aug 11, 2010, 6:15:49 PM8/11/10
to google-analytics-api - GA Data Export API
Set the timezone?

All collected data is processed per the timezone configured in the
Google Analytics Account settings. This configured value can be found
in the timezone property of the account feed. Neither the web
interface nor the API have a way to set a timezone of a query. So if
you are not using the data from the account feed, the data you are
looking at is incorrect.

-Nick

Joris Witteman

unread,
Sep 5, 2011, 5:54:58 AM9/5/11
to google-analytics...@googlegroups.com
Hi Nick,

I'm having the same issue. Could you elaborate on what you said about looking at the wrong data?

I'm loading Visits from the Analytics API with a Date dimension. I'm seeing different numbers for the same dates and URLs between the Analytics website and the results coming from the API. I too thought of timezone differences first. But you're saying the configured timezone for the profile will always dictate the timezone in which the API results are expressed?

Nick

unread,
Sep 6, 2011, 2:06:47 AM9/6/11
to google-analytics...@googlegroups.com
Hi,

Per the original problem (which I still didn't fully understand) of seeing different data between the API and UI, the reason is that the queries that are being issued between both interfaces are different, hence the results are different. So maybe not wrong data but different data.

To answer your question, the day boundaries we use to process data is based upon the timezone configured in the profile. So if the timezone is configured to GMT and you query for June 1st, you get data from all collected hits on June 1st GMT time.
-Nick

Reply all
Reply to author
Forward
0 new messages