carlsoja
carlsoja

Reputation: 324

Is it possible to segment visits by goal completions in Google Analytics?

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

Answers (2)

user2619125
user2619125

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

Ibrahim Ozturkcan
Ibrahim Ozturkcan

Reputation: 71

It is because of

  • you shouldn't use "segment="
  • (n) value should be with out brackets.

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

Related Questions