Problem with ga:userDefinedValue

147 views
Skip to first unread message

Amit Sasturkar

unread,
Nov 18, 2009, 4:57:56 PM11/18/09
to google-analytics-api - GA Data Export API
Hi,

I am trying to fetch the dimension ga:userDefinedValue and the metric
ga:pageviews. If I use the Data Export API, I always get
ga:userDefinedValue set as "not set" and all pageviews aggregated. But
when I view the report on the dashboard, I can see multiple values for
ga:userDefinedValue, and pageviews aggregated separately for each
value.

Is there a restriction on using ga:userDefinedValue from Data Export
API ?

Thanks,
Amit

Amit Sasturkar

unread,
Nov 20, 2009, 1:12:21 AM11/20/09
to google-analytics-api - GA Data Export API
Hi GA team,

Still waiting for a response to original my question. The problem I
see is explained below.

On my analytics dashboard, I see the following report for
userDefinedValue.

UserDefinedValue Visits
(not set) 56
1258507985222 3
1258497015799 1

But, when I fetch ga:userDefinedValue and ga:visits via the API, I get
the following data.

UserDefinedValue Visits
(not set) 123

Two questions :

a) Why don't I see all the userDefinedValue's via the Data Export
API ? Is this a problem with my account, or is this a known
restriction of the API ?
b) Why is there such a big difference between the #visits on dashboard
and when accessed via the API ?

I am a newbie to GA, so please excuse if these are naive questions.

Thanks,
Amit

Nick

unread,
Nov 20, 2009, 1:20:40 PM11/20/09
to google-analytics-api - GA Data Export API
Hi,

The API and UI use the same backend data. So the problem is most
likely that the query you are constructing via the API does not match
the queries our UI are making.

It's really hard (impossible?) to tell what is happening solely based
on the numbers above. The first step I recommend is to see if removing
the ga:userDefinedValue dimension from your query (ie only using the
ga:visits metric) makes the values between the API and the UI the
same. The second step I would look at is selecting 1 day for your date
range between both UI and API query.

Good Luck,
-Nick

Amit Sasturkar

unread,
Nov 20, 2009, 8:56:42 PM11/20/09
to google-analytics-api - GA Data Export API
Perfect ! Thanks Nick ! Restricting the date range to 1 day seems to
have fixed the problem; I can get all user defined values with the
right pageviews via the API. Seems like the cause of the problem was
that my earlier date range extended before the user defined values
were set. So, the API was returning just one value "not set".

Best,
Amit
Reply all
Reply to author
Forward
0 new messages