Kazunari Shirataki
Kazunari Shirataki

Reputation: 13

How to get advanced segment's session data in Google Analytics API?

I would like to know how to get advanced segment's session data in Google Analytics API.

For example, I would like to get session data of /archives/4105, which Google Analytics' setting are:

Advanced: Conditions
Filter: Sessions, Include, Page, exactly matches, /archives/4105

I would appreciate your attention.

Thank you

Upvotes: 1

Views: 241

Answers (1)

Eike Pierstorff
Eike Pierstorff

Reputation: 32760

Easiest way is to use the Google Query Explorer - if your are logged in to the Google (with an e-email-address that has access to the account you want to query) you will see all your segments by name in the "segments" dropdown. If you select a a segment you will see its unique id that can be used in an API query.

Alternatively you can use dynamic segments where you can pass your conditions on the fly.

The use of segments in the reporting API is pretty extensively documented, so you might want to digest that and come back with any specific problems that might turn up.

Upvotes: 1

Related Questions