staccato
staccato copied to clipboard
Support for Google Analytics v4
It seems to be in alpha, but wouldn't it be easy to add support for GA4 ?
https://developers.google.com/analytics/devguides/collection/protocol/ga4
(It is referenced from the v1 protocol https://developers.google.com/analytics/devguides/collection/protocol/v1/ page)
@tpitale is it simply changing the endpoint to /mp/collect
rather than /collect
? Or is it more involved? Would be great to see the WIP branch to perhaps fork it and assist.
Ah I see now that you have to POST a payload with different keys rather than simple URL params.
Perhaps. I might be conflating this with the query side in my other library Legato. 🤔
You're welcome to give it a shot.
It looks like this only supports POST requests, which is different. Not just a path or endpoint change.
Or I may have just forgotten how my own library works 😂
I've read through the docs a bit. This is a much bigger change to how the last protocol worked.
The list of events is extremely varied. That said, I don't think this would be impossible to integrate into the same library.
I can try to take a run at it ASAP.
@tpitale hi there, is there any update on this, please?
No update. Between COVID and parenthood, it's tough to find the time. PRs welcome!
@tpitale hello, any update on this issue so far? :) Where i can find your draft PR on this issue to try to maybe tackle it if you can't?
No updates. This appears to be in Beta. I'm prioritizing support for V4 in Legato before I come back to work on this. PR's welcome, but it appears to be a non-trivial change.
+1 to this one. Would be great to start collecting GA4 data before they stop processing data of Universal Analytics properties on July 1, 2023
+1 can you push your branch @tpitale tpitale than I will help finishing it.
No branch. Still working on Legato first.
V4 is wildly different. There isn't a lot to reuse here. All the events are different: https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events
Would you say that it is better to create a new gem for it? So that we can run Staccato and Staccato-GA4 together and have UA and GA4 data
I started messing around with this a little more last night since there is renewed interest. I think it could live in the same gem and be usable together.
The new event protocol is so much more simple, as compared to the v1 protocol.
I can probably knock out 1 or 2 of the events and push up that branch. It's really just translating the events to ruby, so anyone should be able to follow my pattern and help port that part.
I made some progress on this tonight. I'll try to do a little work over the weekend while my kid is napping.
Here's a draft I've started, for everyone watching. I'm installing ruby on my new machine, so pausing here.