aawnu / php-ga4

PHP Library for Google Analytics 4 with Server Side Tagging
The Unlicense
53 stars 9 forks source link

Client id must have been created by gtag.js? #71

Closed 8ctopus closed 1 year ago

8ctopus commented 1 year ago

I have found this in the google doc:

In order for an event to be valid, it must have a client_id that has already been used to send an event from gtag.js. You will need to capture this ID client-side and include it in your call to the Measurement Protocol. In send an event to your property, we use "client_id" as the client_id. You will need to replace this with a real client_id that comes from gtag.js.

Does your practical experience corroborate the quote or not?

If affirmative, I think it should be added to the doc.

I'm adding the stackoverflow question that made me think about this if you're interested https://stackoverflow.com/questions/69105735/google-analytics-4-measurement-protocol-api-used-without-gtag-js-or-firebase

aawnu commented 1 year ago

It is already in the documentation that you 'should' use the gtag identifier.

It is entirely possible to use custom identifiers if you rely solely on server side tracking, but the gtag id will ne necessary for the auto-collected information.

8ctopus commented 1 year ago

Thank you.