So you want to access Google Analytics data for a particular segment?
- Define a segment in the Google Analytics web view.
- Go to https://ga-dev-tools.appspot.com/query-explorer/, select the segment that you want to use and you'll get a segment ID like the highlighted in the image.
In Python, if you are using Pandas to get GA data, just pass in the segment ID, in my case
dfQry = ga.read_ga(metrics=metrics, dimensions=dimensions, start_date=start_date, end_date=end_date, account_id=account_id, segment=segment, property_name=property_name, property_id=property_id, profile_name=profile_name, index_col=0 )
If that doesn't work, you can copy it out of the URL in