-
Notifications
You must be signed in to change notification settings - Fork 7
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
Discussion: Use google measurement protocol for ecommerce events (enhanced compatibility with HTTP Events API) #17
Comments
Hello @agcty , and thanks for starting this discussion!
To which client.fetch() calls are you referring to exactly please? I can see two: one is related to GA Audiences, and the other one for DoubleClick. Both, to my knowledge, could be ignored if you wish to go only serverside, and you should still be able to see data coming in in GA4. It will probably affect anything related to G Ads conversion tracking and retargeting, as these still rely on 3rd party cookies. |
Sorry for the delayed response! Yes, there are two fetches that need to be called: GA Audiences and DoubleClick. However, I believe you also need to execute some client side code that the MC sends back for the event to be tracked successfully, the two fetches are not sufficient. Ideally, I wouldn't want to execute that code on the client (e.g via eval), I believe using the measurements api would solve that. For more context, this is our use case: I am not sure what to make of this because I think the MC would potentially need to be rearchitected in parts to use the Measurements Protocol. However this also poses challenged as not everything can be collected over the MP: https://developers.google.com/analytics/devguides/collection/protocol/ga4#full_server-to-server. I guess you could work around that with blocking triggers and calling the Measurement Protocol directly yourself. Maybe you could even have a property in the MC that forces the MP in some cases. Again, don't know the best solution or if this is even worthy of discussing. |
Currently, the google managed component doesn't use the measurement protocol for tracking ecommerce events. However, it seems particularly useful for exactly that in server-side environments.
Current state
Right now, when using the HTTP Events API, the MC will return a few client fetch requests which you then have to manually execute on the client side, if you don't do that, the checkouts, etc won't be tracked.
Proposed solution
While you can definitely return the response object of the tracking call and forward it to the client, this seems a little sub-optimal as there is an actual API from Google that you can use for exactly this scenario (and only this scenario, the measurement protocol doesn't allow you to send pageviews for example). Instead of client.fetch, manager.fetch could be called with the ecommerce request payload. This would also be more resilient against ad blockers.
I know that a lot of other questions would have to be answered to assess if this is feasible. This issue is to identify what these are and to start a discussion about using the measurement protocol in general.
The text was updated successfully, but these errors were encountered: