-
Trouble Implementing GA4 Custom Event with Measurement Protocol Data
Hey everyone,
I’m knee-deep in setting up a custom event on GA4 (Admin > Events > Create an Event) that triggers whenever someone makes a purchase.
I’ve been firing a “purchase” event using the measurement protocol, here’s what that object looks like:
{ "client_id": {{clint_id}}, "user_id": {{user_id}}, "events": [ { "name": "purchase", "params": { "value": {{value}}, "user_plan":{{plan}}, "currency": "USD", "transaction_id": {{transaction-id}}, "items": [ { "item_id": {{item-id}}, "item_name": {{item-name}} } ] } } ] }
This bit seems to be going off without a hitch – I can see the event in GA4 in real time and in other reports.
The hiccup comes when I try to create a custom event for a specific scenario – say, if user_plan equals “testing_plan”. I crafted a new event as follows:
parameter = event_name value = purchase parameter = user_plan value contains testing_plan
And… zilch. It’s like the event has dropped off the face of the earth. I rummaged through the documentation and couldn’t find anything that could be of help.
Weird bit is that if I send the purchase event using gtag, the custom event actually works! And GA chatbot suggested changing event_name to “en”, but that does nada too.
If anyone has any leads – or even wild guesses – on what’s happening, feel free to share away!
Log in to reply.