5.8K members online now
5.8K members online now
Everything you need to know about setting up Optimize including creating your account and container, linking to Google Analytics and how to tag your site.
Guide Me

Server side experiment using Google Tag Manager

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭



I've implemented my experiment on our own server (as we had to keep the url the same for commercial reasons). Our server decides between experiment 0 and 1 and inform Google via the data layer as follows:




  googleOptimizeExperimentId: '[experimentIdHere]', 
googleOptimizeExperimentVariation: '1', event: 'optimiseExperimentLoad' });



Then in our Tag Manager config, we have the following under "More settings' on the Google Optimize tag.



Fields to  Set Field Name Value

expId  {{googleOptimizeExperimentId}}

expVar {{googleOptimizeExperimentVariation}}

Those variables reference variables we've set up to look at the data layer.


We're not getting anyone on variation 1 of the checkout despite visiting it ourselves.


Anyone have any ideas what may cause this?

1 Expert replyverified_user

Server side experiment using Google Tag Manager

Google Employee
# 2
Google Employee



Are you interested in using any of the targeting functionality of Optimize (i.e. geo targeting etc)?


It sounds not since you probably make the full decision and decide to show the variants on the server side.


If this is the case, you don't really need to use the Optimize tag - you need to do the configuration on the GA side:


ga('set', 'exp', '$experimentId.$variationId');


See: Optimize Server-side Experiments


Experts in the Topic
Dimitris D