How to append a Variation ID as a parameter to page links

Issue

Sometimes we may want to attribute a conversion in a third party system to a specific variation. 

A real world example would be that we need to know which customer received a certain offer or discount that was run in a Convert experiment.

We might be able to catch that on a third party system such as a CRM, with a link parameter. 

This article will explain how to add the variation id to the links in your experiment page.

Solution 

Add the following code to your "Global Experience JS section". You can find it in the Visual Editor by clicking on the gear icon.

Make sure that you know the selector of the link you want to change, to replace it in the code. If you want to change all of them, just replace the "selector" to "A". That would change all link selectors.

*Split URL experiments do not have this section, so you would need to add it to the Global Project JavaScript section of your Project on those cases.

 


If you preview your variation with the preview or force variation links provided in the Visual Editor, you should see the change in your link.

Have more questions? Submit a request

Comments