staccato icon indicating copy to clipboard operation
staccato copied to clipboard

Support for Google Analytics v4

Open Startouf opened this issue 3 years ago • 19 comments

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)

Startouf avatar Apr 26 '21 11:04 Startouf

@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.

atran avatar May 03 '21 23:05 atran

Ah I see now that you have to POST a payload with different keys rather than simple URL params.

atran avatar May 04 '21 00:05 atran

Perhaps. I might be conflating this with the query side in my other library Legato. 🤔

You're welcome to give it a shot.

tpitale avatar May 04 '21 00:05 tpitale

It looks like this only supports POST requests, which is different. Not just a path or endpoint change.

tpitale avatar May 04 '21 00:05 tpitale

Or I may have just forgotten how my own library works 😂

tpitale avatar May 04 '21 00:05 tpitale

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 avatar May 04 '21 23:05 tpitale

@tpitale hi there, is there any update on this, please?

FrantisekVrab avatar Jan 28 '22 15:01 FrantisekVrab

No update. Between COVID and parenthood, it's tough to find the time. PRs welcome!

tpitale avatar Jan 28 '22 15:01 tpitale

@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?

returnv01d avatar Apr 27 '22 10:04 returnv01d

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.

tpitale avatar Apr 27 '22 16:04 tpitale

+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

yaroslav-mo avatar May 31 '22 16:05 yaroslav-mo

+1 can you push your branch @tpitale tpitale than I will help finishing it.

Paradoxor avatar Jul 18 '22 15:07 Paradoxor

No branch. Still working on Legato first.

tpitale avatar Jul 20 '22 18:07 tpitale

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

tpitale avatar Jul 21 '22 00:07 tpitale

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

yaroslav-mo avatar Jul 21 '22 14:07 yaroslav-mo

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.

tpitale avatar Jul 21 '22 17:07 tpitale

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.

tpitale avatar Jul 21 '22 17:07 tpitale

I made some progress on this tonight. I'll try to do a little work over the weekend while my kid is napping.

tpitale avatar Jul 23 '22 00:07 tpitale

Here's a draft I've started, for everyone watching. I'm installing ruby on my new machine, so pausing here.

tpitale avatar Jul 24 '22 01:07 tpitale