Reputation: 11
Is there any way to get source info from Google Analytics for specific Client ID by API? Like I can get it using GUI in GA - https://prnt.sc/rdfpo6
PS. Found needed info - https://developers.google.com/analytics/devguides/reporting/core/v4/rest/v4/userActivity/search
Upvotes: 0
Views: 245
Reputation: 13334
The Client ID isn't exposed via the API (same with the User ID), so instead you want to record the Client ID as a custom dimension:
https://www.simoahava.com/analytics/improve-data-collection-with-four-custom-dimensions/#2-client-id
And then you can query it via the API using ga:dimensionXX
where XX
is the dimension index:
https://ga-dev-tools.appspot.com/dimensions-metrics-explorer/#ga:dimensionXX
Upvotes: 1