Reputation: 324
I have a website, and want to use the Google Analytics API to give me data that only includes visits with a specific goal completion (say goal 2). I'm trying to use the ga:goal(2)Completions metric in a segment to get this data like this:
segment=dynamic::ga:goal(2)Completions!=0
However, whenever I try this in the Query Explorer I'm told this is an invalid segment value. I don't see goal(n)Completions as a disallowed metric for use in segments in the documentation (https://developers.google.com/analytics/devguides/reporting/core/v3/reference#segment), so what's the problem here? Is there a different way to get this data segment?
Upvotes: 2
Views: 1360
Reputation: 1
And if you want to do the opposite use segment= dynamic::ga:goal2Completions==0
You can double-check it by running the query without segmentation - both above should sum up the the latest one.
Cheers
Upvotes: 0
Reputation: 71
It is because of
ids= ga:XXXXXXXX
start-date= 2012-01-01
end-date= 2012-01-31
metrics= ga:visits
segment= dynamic::ga:goal2Completions!=0
I have tested and the sample above should work fine.
Upvotes: 1