https://www.growthbook.io/ logo
s

sparse-island-75978

08/28/2023, 11:25 AM
Hi everyone! I wonder if we should follow the GA4
experiment_viewed
event structure as it’s given in docs sample when firing it in tracking callback. Can we use our own
event_category
(e.g ‘AB Tests’ instead of ‘experiment’) or call it
experiment_impression
instead and follow the format we had while using Google Optimize? What we’ve found in docs:
Copy code
window.gtag("event", "experiment_viewed", {
  event_category: "experiment",
  experiment_id: experiment.key,
  variation_id: result.variationId,
  ...
})
What we’d like to send:
Copy code
gtag('event', 'experiment_impression', {
  event_category: 'AB Tests',
  experiment_id: expId,
  variant_id: `${expId}.${variantId}`,
})
w

white-fireman-22476

08/28/2023, 11:29 AM
I believe you can but you would then have to modify the default experiment assignment query to match.
s

sparse-island-75978

08/28/2023, 11:33 AM
Thank you for the answer! Should I modify query if I only change the
event_category
value? @white-fireman-22476
w

white-fireman-22476

08/28/2023, 12:05 PM
I'm not positive. I don't see event_category in our default assignment query for GA4, so you might be ok there.
Modifying the default experiment assignment query would be a one time task though. So not a huge deal.
s

sparse-island-75978

08/28/2023, 12:13 PM
Thank you!
3 Views