How to get data for multiple segments with one data request without using the gaid:xx definition?

150 views
Skip to first unread message

Daan Bouwmeester

unread,
Mar 9, 2018, 6:32:57 AM3/9/18
to google-analytics-spreadsheet-add-on

Hi,


It is possible to look at up to 4 different segments in GA

When analysing with Google API V4 + Sheets it's possible to do when using the gaid:xx segment definition and by adding a "," between multiple segments. This will results in visitors for both the segments separately.


Is it also possible to analyse multiple segments when writing out the segments instead of the gaid:xx?

Example: sessions::condition::ga:deviceCategory==desktop & sessions::condition::ga:deviceCategory==tablet


Is there an operator such as the "&" I've just used?

When I place a "," between to written out segments it treats it as an OR function and it is seen as one big segment with the condition where the visitor is deviceCategory: desktop or tablet.

But I would like to be able to use multiple segments to and get data separately for the segments.


Not all employees share the same segments and it takes too much time to share all segments with everyone in and outside the organization. By writing out segments it enables everyone to have a standardized way of analyzing.

 

And this would drastically reduce the amount of request I would make -> less reports -> won’t reach the 2.000.000 cap as fast-> I can add more things to my API files :D


Best regards,


Daan



Philip Walton

unread,
Mar 12, 2018, 4:31:10 PM3/12/18
to daa...@gmail.com, google-analytics-spreadsheet-add-on
You should be able to write your segment definition like this (though a device category will never be both desktop *and* tablet):

sessions::condition::ga:deviceCategory==desktop;ga:deviceCategory==tablet

You can refer to the segment syntax documentation here:



--
You received this message because you are subscribed to the Google Groups "google-analytics-spreadsheet-add-on" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-analytics-spread...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-analytics-spreadsheet-add-on/e85fa7e2-5161-48d5-b9ac-0ebecac6b906%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages