Rich-text Reply

Vary content by audience

lexap 01-26-15

Vary content by audience

I want to set up a page that varies by audience. 

If utm_campaign=xyz, the visitor should show the xyz variation.
Else if utm_campaign=abc, the visitor should see the abc variation.
Else it should show the original.
Is this possible?
Level 1

Brian_Abad 01-26-15

Re: Vary content by audience

[ Edited ]

Hey @lexap ,


Thanks for posting your question!


If you are familiar with JavaScript, you can utilize an if statement and Optimizely's API to bucket visitors into a particular variation. This can be found in our API documentation here:


If JavaScript is not an option, an alternative would be to create 2 separate experiments -- 1 for one of the query parameter condition and another for the other query parameters. More on query parameter Audience conditions can be found here: Then, set 100% Traffic Allocation to the variation in which you are making changes.


This set-up will ensure visitors with utm_campaign=xyz are bucketed into an experiment and see the variation, visitors with utm_campaign=abc are bucketed into a separate experiment and see its variation, and visitors without either continue to the original version of your webpage.


I hope this helps!

Brian Abad
Manager, Technical Support
Customer Success