-
Exploring the Transition from Google Universal Analytics to GA4 Event Tracking
We’re currently using the Measurement Protocol in Google Universal Analytics to parse our streaming server logs and post everything as events. But we’re now wondering how we can make this happen for GA4. For instance, here’s an example of a post we make with a PHP script using curl when someone tunes into one of our HD channels:
v=1&tid=UA-123456789-1&cid=a76-b177-b238-b39d-634225a16b6e&ds=web&ua=AppleCoreMedia%2F1.0.0.19G71%20%28iPad;%20U;%20CPU%20OS%2015_6%20like%20Mac%20OS%20X;%20&ul=en-us&uip=1.2.3.4&cs=event&cn=station&cm=stream&ck=WXYZ%20HD3%20The%20Channel&t=event&ec=Stream&ea=Listen&el=WXYZ%20HD3%20The%20Channel&ev=10&cg1=Hour10&cg2=channel&cg3=Midday%20Weekdays%209am-1pm
We usually find these Events under the Behavior section in Universal Analytics, sorted under the Event Category of Stream. I wrote the script using the Measurement Protocol parameter reference, which now surprisingly shows a link to GA4’s Measurement Protocol at the top of the page – but without a similar guide to parameters. As you can probably notice, we’ve mainly posted to categories, actions, labels, and even custom groups.
Here’s another example where a listener tunes into a show that posts to campaign source/media events:
v=1&tid=UA-123456789-1&cid=a97-b76-b210-b2d-634225a16b6e&ds=web&ua=Mozilla%2F5.0%20%28Windows%20NT%2010.0;%20Win64;%20x64%29%20AppleWebKit%2F537.36%20%28KH&ul=en-us&uip=1.2.3.4&cs=event&cn=station&cm=stream&ck=The%20Show&t=event&ec=Stream&ea=Listen&el=The%20Show&ev=10&cg1=Hour1&cg2=podcast&cg3=Midday%20Weekdays%209am-1pm
Any kind soul out there who can point us in the right direction for converting these to GA4 events?
Log in to reply.