Data retrieved does not match that seen via Analytics Web site itself

3,119 views
Skip to first unread message

SnowDog

unread,
Feb 26, 2011, 2:27:16 PM2/26/11
to google-analytics-api - GA Data Export API
Hi

New to the Analytics API but have ready a few posts to check this
isn't something really silly.

I'm looking up

query.Dimensions = "ga:source"
query.Metrics = "ga:visitors"

Via the API and also via logging into Analytics via a browser

Date Range: 1st Jan 2011 - 1st Jan 2011 (Just one day) - nice small
sample.

My Application via the API agrees 100% with :
http://code.google.com/apis/analytics/docs/gdata/gdataExplorer.html
as it should.

However if I log into Analytics in a browser the figures are
approximately 4% larger.

The data I get back from the API does not imply the data is samples or
anything else:
"
Metric Type = integer
Metric CI = 0.0"

so I am at a loss as to why there is a varience in the numbers of
visitors by source.

Any ideas out there? I'm not going to get anywhere if the numbers have
a varience as we'll have no confidence in them.

Thanks in advance.

SnowDog

unread,
Feb 26, 2011, 5:54:54 PM2/26/11
to google-analytics-api - GA Data Export API
I think its down to time periods.

Some of the stats are perfect and others are not. And the one that is
perfect I know all the traffic was early in the day - nothing in the
evening......

I am using the date range 2011-1-1 to 2011-1-1 so there should be no
issue - but could the time zone of the calling application (My App is
UK time - Googles Web testing App is ??? Pacific time?)

Thoughts?

SnowDog

unread,
Feb 27, 2011, 10:37:29 AM2/27/11
to google-analytics-api - GA Data Export API
I've been looking through the forum quite extensively and many other
people have asked a question similar to this - and in all cases the
question is unanswered.

Can someone from Google put an answer up so it can used by everyone in
future?

Thanks

Nick

unread,
Feb 28, 2011, 1:39:54 PM2/28/11
to google-analytics...@googlegroups.com
It's a tricky question...mostly because people don't give specifics as to where in the UI they are viewing the reports.

The typical answer is that your query in the API is different than that of the UI. (we don't actually expose the query the UI is making so it's very easy to make this mistake.)

Unless you use custom reports, you can't get visitors and source in the UI. Try the visits metric instead.
-Nick

SnowDog

unread,
Feb 28, 2011, 5:37:01 PM2/28/11
to google-analytics-api - GA Data Export API
Hi Nick

Thanks for coming back to me.

I'm not using custom reports to get Visitors/Source in the UI - so I
guess I'm missing something.

Let me explain exactly what I have and I guess the area of mis-
communication/confusion will become apparent.

On http://code.google.com/apis/analytics/docs/gdata/gdataExplorer.html

I have
dimensions = ga:source
metrics= ga:visitors
sort = -ga:visitors
start and end date: 2011-01-01

and I get a google sourced traffic figure approx 8% less than:

Web Analytics UI--> Navigation to same Profile (triple checked):

Select Start/Finish Date 1st Jan 2011.
Go to --> Traffic Sources --> All Traffic Sources
And from the drop down called "show" I choose just "Source"

In my mind these should be identical in meaning .......

What have I got wrong?

Thanks

Stuart

Nick

unread,
Feb 28, 2011, 5:46:54 PM2/28/11
to google-analytics...@googlegroups.com
The all traffic sources report shows "visits" not visitors.

The only way to get unique visitors with sources is to create a custom report and use the "Unique Visitors" metric.

-Nick

SnowDog

unread,
Feb 28, 2011, 7:29:22 PM2/28/11
to google-analytics-api - GA Data Export API
Hi Nick

Now I am asking for VISITS by Source they completely agree

Thanks for helping me understand the exact nature of the questions

Many Thanks

Stuart

Nick

unread,
Feb 28, 2011, 8:54:41 PM2/28/11
to google-analytics...@googlegroups.com
Perfect. Glad it's working for you!

Mike Swan

unread,
Feb 27, 2013, 2:47:58 PM2/27/13
to google-analytics...@googlegroups.com
Hi Nick,

I am running into a similar issue I was hoping you could help me define.  Specifically, when I query the API for social networks and include goalCompletionsAll I am getting numbers that do not match the web interface in Social->Conversions.  Some match, others are off by a mile (like hundreds).  Additionally, the API is including social networks that are not even showing in the web interface but should.  Can you shed some light on this discrepancy?  Am I using the wrong metric, or does the web interface do some calculation on the metrics before rendering?  Thanks.

Mike

Nick

unread,
Mar 4, 2013, 8:48:22 PM3/4/13
to google-analytics...@googlegroups.com
What is your query.

The main reason why the API and UI data differs is that the queries used by both, differ, so you are querying for different data and why the results are not the same.

-Nick

Mike Swan

unread,
Mar 5, 2013, 12:59:53 PM3/5/13
to google-analytics...@googlegroups.com
Hi Nick, thanks for the response.  I am querying using this:

$ga->requestReportData($GAProfile,array('socialNetwork'),array('pageviews','visits','goalCompletionsAll','timeOnSite','transactionRevenue'),$sort_metric=array('-goalCompletionsAll','-visits'), $filter='socialNetwork!=(not set)&&visits!=0',$begin,$end);

I will be migrating over to the new API soon, but the rest of the info matches the UI, so I don't think it is the problem.  Thoughts?  Thanks.

Mike

Nick

unread,
Mar 5, 2013, 2:06:48 PM3/5/13
to google-analytics...@googlegroups.com
Hi,

Whats the actual http request you are sending Google Analytics?

-Nick
Message has been deleted

Mike Swan

unread,
Mar 5, 2013, 2:21:55 PM3/5/13
to google-analytics...@googlegroups.com

Mike Swan

unread,
Mar 5, 2013, 2:27:59 PM3/5/13
to google-analytics...@googlegroups.com
Also, my results match the query explorer, which also does not match the UI.  This is my main reason for thinking I am asking for something different.  Hope this helps.  Thanks.

MS 
Reply all
Reply to author
Forward
0 new messages