Mobile app version of vmapp.org
Login or Join
Phylliss660

: How to use segments in google analytics API In google analytics, We are able to create segments like below: From the Google analytics API explorer, we can pull the segment information be it

@Phylliss660

Posted in: #Analytics #AnalyticsApi #Api #GoogleAnalytics #UniversalAnalytics

In google analytics, We are able to create segments like below:



From the Google analytics API explorer, we can pull the segment information be it by segment id or by its code:



I would assume we can just cut and paste that code into the google analytics core reporting v3 reference code like we do with all the other parameters:



When I run the code however, i get this error:

Arg, there was an API error : 400 : Invalid value 'users::condition::dateOfSession==2015-04-30;ga:sessionCount==1;condition::ga:campaign=@33100;sessions::condition::ga:userType=@Returning Visitor'
for segment parameter.


Not sure whats wrong. When i use the segment id instead in my code for the segment parameter(segment ='gaid::xxxxxxx'), i get this error:

Arg, there was an API error : 400 : Segment XXXXXXXXXXX is not supported in the API.


Not sure how i should structure the code. Please help.

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Phylliss660

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme