I have setup a Google Optimize server side experiment (linked to GA4) following their documentation in this link. Once I start running the test and after a few days, I can see the experiment impression events coming through on both Analytics and the Optimize experiment report page. The primary objective for this experiment is a conversion event we have on GA4 called add_to_cart
, which is triggered every time the user clicks on the add to basket button.
So when the page loads, our server side code decides the user variant and we trigger the experiment_impression
event. Up to this point everything seems fine. After that the add_to_cart
conversion event is triggered whenever the add to basket button is clicked. I have checked on the network tab that those events are being triggered correctly.
However, I get 0 events for every variant of my experiment on the Google Optimize report:
It seems Google Optimize thinks the experiment is not running when the user clicks "add to basket" (even though we trigger the experiment_impression
event) and therefore it considers that the add_to_cart
conversion event doesn't belong to our experiment, hence the lack of reporting.
Could somebody please help me understand what is wrong with this setup? Is there a way to somehow link our add_to_cart
conversion event with our server side experiment?
Thank you