Search code examples
javascriptab-testinggoogle-optimize

Google optimize - Conversion events not being reported on server side experiment


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:

Optimize reporting 0 events for add_to_cart conversion event

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


Solution

  • After carrying out a full review in our setup, we noticed there was something wrong with our Google Tag Manager and the Experiment Impression tag wasn't firing as expected. In order to discover this, we used the "Preview" button in our GTM dashboard to check which tags were being fired, that's how we discovered that the tag wasn't firing properly. After fixing the issue and checking that the tags are firing, we now get Conversion events displayed on the Google Optimize experiment report and everything seems to be working as expected. So please, if you have this issue check that your tags are firing correctly.