Optimize
4.7K members online now
4.7K members online now
Learn how to create your first experiment and get tips on creating A/B, redirect, and multivariate tests.
Guide Me
star_border
Reply

Server side testing not working

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Howdy!

 

I'm running a server-side experiment, wherein we divert 50% of traffic to a different URL. I've followed the instructions at https://developers.google.com/optimize/devguides/experiments but I'm not seeing any results. No matter what I try, the 

ga('set', 'exp', 'EXPERIMENTID1')

code does not seem to ever register any visitors to the experiment. Using the GA debug tools, I see the pageview event posted, with the corresponding `exp` property successfully sent.

 

To me, the instructions about setting a target URL of "SERVER_SIDE" seem awfully goofy, and perhaps are misdocumented?

 

Is anybody running a successful server-side experiment?

 

Andy Fowler

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Andy F
June

Server side testing not working

Google Employee
# 2
Google Employee

It appears you are sending slightly incorrect experiment information. 'EXPERIMENTID1' should be 'EXPERIMENTID.1' (note the period before the '1') The period separates the experiment ID from the variation ID. The suggestion of using "SERVER_SIDE" is there simply to prevent accidentally triggering the experiment if you happened to include the Optimize container on your website.

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Andy F
June

Server side testing not working

Google Employee
# 2
Google Employee

It appears you are sending slightly incorrect experiment information. 'EXPERIMENTID1' should be 'EXPERIMENTID.1' (note the period before the '1') The period separates the experiment ID from the variation ID. The suggestion of using "SERVER_SIDE" is there simply to prevent accidentally triggering the experiment if you happened to include the Optimize container on your website.

Server side testing not working

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Thank you, Jim! That did the trick. I completely missed it in the sample code: I read it as PHP's concatenation operator. I'm on track now!

 

Andy

Server side testing not working

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Hi! 

 

I'm trying to figure out how to set this up and had a couple questions hopfully someone here could help clarify:

 

1) Did you use this  command   " ga('set', 'exp', 'EXPERIMENTID1') " inside the analytics snippet as mentioned in the docs here: https://developers.google.com/optimize/devguides/experiments ?

 

2) We don't have a GA snippet on page and rather use a UA tag inside GTM to implement this. So I'm a little confused about where exactly would you place this command i.e. " ga('set', 'exp', 'EXPERIMENTID1') " or if you would not use that at all and implement it differently ? 

 

3) Lastly, where are you getting this value ('EXPERIMENTID.1' ) from on the page? It was not fully clear to me from the documentation. Does your back-end script create on-page JS variables or dataLayer variables for experimentID and variation number that can be accessed on the page to include in this ga.set command?    

 

Thanks a lot!