aawnu / php-ga4

PHP Wrapper for Google Analytics 4 with Server Side Tracking

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Client id must have been created by gtag.js?

8ctopus opened this issue · comments

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

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.

Thank you.