How can I find the segment id?

3,532 views
Skip to first unread message

TheGoogler

unread,
Nov 7, 2010, 12:29:28 PM11/7/10
to google-analytics...@googlegroups.com
Guys,
I have created an advanced personalized segment in GA. Now I want to reach it in my java code: query.setSegment("gaid::2")

A problem is that I dont know the id of the segment. Where can I find it?

mike@analyticsedge

unread,
Nov 8, 2010, 11:26:34 PM11/8/10
to google-analytics-api - GA Data Export API
They are listed in the old Account Feed or using the new
ManagementAPI, the advanced segment feed.

...or...

you can view the page source of any of your GA report pages and look
for the description of your Advanced Segment, then see the Value="###"
beside it.

mschenkel

unread,
Nov 25, 2010, 7:12:27 PM11/25/10
to google-analytics-api - GA Data Export API
I am using this for my account feed:
https://www.google.com/analytics/feeds/accounts/default

I am not getting the segments neither. Is this NOT the "Old Account
Feed"? Should I get segment ids using this feed?

mike@analyticsedge

unread,
Nov 26, 2010, 10:18:16 PM11/26/10
to google-analytics-api - GA Data Export API
Sorry - I was trying to differentiate the much more recently released
Management API which has a section called "Account Feed". You have
the right link, and it returns dxp:segment's for me, as it says in the
documentation:
http://code.google.com/apis/analytics/docs/gdata/gdataReferenceAccountFeed.html

Nick

unread,
Dec 1, 2010, 9:26:48 PM12/1/10
to google-analytics-api - GA Data Export API
You should get the segment ID in the Data Export Account Feed only if
you use the version 2 header.

Like Mike said, there is an entire advanced segment feed in the
Management API: http://code.google.com/apis/analytics/docs/mgmt/mgmtFeedReference.html#advancedSegmentFeed

-Nick
Reply all
Reply to author
Forward
0 new messages