I am trying to display the contents of a Google Analytics segment using a script called Oochart .
To do this, I need a segment identifier, how can I find it?
There is no easy way. You need to either try to read it from the URL when applying the segment, or select a segment in the query explorer (http://ga-dev-tools.appspot.com/explorer/), which then displays the segment identifier.
The Advanced Segment Feed provides a list of all standard and user-defined segments. You can get the identifier of all segments in this standalone explorer. (under the heading "Try it!"):
https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/segments/list#try-it
You need to authenticate requests using OAuth 2.0.
As LCarey briefly mentions, you can read it at the url. I will explain this with an example.
Apply segment and see url.
Example: https://www.google.com/analytics/web/#report/visitors-overview/a27824002w53282758p54121492/%3F_.advseg%3Duser1417962107/
You are looking for the advseg option. In this case, the segment identifier is user1417962107. % 3D characters mean the equal sign "=".
In the API, you would use segment = gaid :: user1417962107
While the best answer is the one from LCarey (for using Query Explorer: http://ga-dev-tools.appspot.com/explorer/ ), I found that the answer from Pavel is updated if you want to go like this way, instead of changing the structure of the URL.
Consider the following URL:
https://analytics.google.com/analytics/web/#report/defaultid/a23080303w45291587p45450834/%3F_.useg%3DuserfSRDEURzSXe_Kspo6mxgXw/
You are looking for the string "_.useg% 3Duser" followed by the segment identifier (fSRDEURzSXe_Kspo6mxgXw). To use this in the API, I would use gaid :: fSRDEURzSXe_Kspo6mxgXw.
Source: https://habr.com/ru/post/1447719/More articles:Restore alarm manager after phone reboot - androidMagento multimedia email store - phpGCM server using Google app - androidDeploying an MVC 4 application on localhost gives HTTP 404 error - asp.net-mvcCSS print layout adds extra page - cssASP.net MVC 4, How to keep default routing after publishing a project - visual-studio-2012Surface slider doesn't setter - primefacesRails field_with_errors and Bootstrap form-horizontal - htmlSQL converts 'DDMMYY' to datetime - sqlThe difference in performance when reading / writing many files with EPPlus and Spreadsheet Gear - performanceAll Articles