Hi everyone! I wonder if we should follow the GA4 ...
# announcements
s
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
I believe you can but you would then have to modify the default experiment assignment query to match.
s
Thank you for the answer! Should I modify query if I only change the
event_category
value? @white-fireman-22476
w
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
Thank you!