AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

2.8K members online now
2.8K members online now
Discover how to select who is eligible to be in your experiment, and when they’re served experiment variations.
Guide Me

Test on Google Optimize

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi Guys,


I want to build a test for a landing page that has 5 versions of text that change based a parameter in the URL.

It is a kind of a penalization test for an Adwords Campaign.


The problem is that the targeting options allows us to decide if the user will participate in the test based on URL, but not to decide which version the participant will receive based on the URL.

Do I understand this correctly ? Am I missing anything ?






1 Expert replyverified_user

Test on Google Optimize

Google Employee
# 2
Google Employee

Hi Liron


Yes, I am not sure that there is an easy out of the box solution for what you want right now.


Still everything can be done with a little bit of javascript, if you are a bit comfortable with it or have someone that can help.


Click on the element with the text and select the "Run javascript" option from the "Edit Element" menu.


The write some code that looks like that:


var param ="yourParamName=")[1];


// You may look for more robust ways to get your parameter:


if (param == 'value1') element.innerText = '<Text for value1>'

else if (param == 'value2') element.innerText = '<Text for value2>'



or something similar to that.


For targeting, you will need to define a query param variable (for your param's name) and type all of your values (on the same rule - it accepts multiple values) and the experiment will run for any of them.