Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client ID description misleading? #31

Closed
sk0g opened this issue Jan 18, 2022 · 1 comment
Closed

Client ID description misleading? #31

sk0g opened this issue Jan 18, 2022 · 1 comment

Comments

@sk0g
Copy link

sk0g commented Jan 18, 2022

Are we sure the Client ID has anything to do with the ones you can generate in the Console, and not localist entirely to Google Ads? Per the piece of code describing client_id, it is the API Client ID that you have to generate once. This is also repeated in README.MD.

client_id : string
Getting your Google API client ID: https://developers.google.com/identity/one-tap/web/guides/get-google-api-clientid

I'm not entirely sure that is right however.

GA v4 [0] describes client_id as "Uniquely identifies a user instance of a web client", in contrast to user_id which is "A unique identifier for a user". So it's identifying the user + device combination.
GA v3 [1] describes cid as "This field is required if User ID (uid) is not specified in the request. This pseudonymously identifies a particular user, device, or browser instance. For the web, this is generally stored as a first-party cookie with a two-year expiration. For mobile apps, this is randomly generated for each particular instance of an application install. The value of this field should be a random UUID...", which echoes the definition above, also greatly expanding it.

From both of those definitions, the Client ID field is a different thing to Google Console API Client ID. In fact, the wizard for creating the API keys does not even have options for Ads/Analytics/GA, or other similar keywords I tried. Providing a random value in the field would work, but it wouldn't be helpful for collating and aggregating the data as GA would be attempting to.

Mind you, I have roughly zero expectations in terms of accuracy or up-to-date-ness when it comes to Google documenting their APIs and products, so this could all well be completely wrong.

[0] https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference?client_type=gtag#payload
[1] https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters

UPDATE: Found some documentation further describing the expectations for the client_id field: https://developers.google.com/analytics/devguides/collection/protocol/ga4/verify-implementation?client_type=gtag#client_send

@rptomey
Copy link
Member

rptomey commented Oct 10, 2022

You're correct. The previous version's description of what was expected for the client_id field was incorrect. This has been fixed in the newest major update.

@rptomey rptomey closed this as completed Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants