The Script Runner allows you to run plain JavaScript for site visitors when they enter or leave Permutive segments.

To create a script runner reaction, you simply need the script you wish to run, and the Permutive segment you wish to target it to set up.

Here's some more information about each of the fields you need to fill in:

Code: The JavaScript you wish to run for the user. This can be JQuery, as long as there is JQuery installed on the page you're running the reaction on. Please note, a mixture of HTML and JavaScript will not work, the script will need to be in plain JS.

Target this reaction to: The segment you want to see this reaction.

Triggers (On Entry / On Exit / Every Time): When you want the script to run. On entry to a segment, when a user exits a segment, or every time they visit a page while in that segment.


When using the Script Runner, you can track impressions for the reaction. You can do this by using 'impression()' in your script.


If you want to test a script on different audiences, or different script content you can set up multiple variants. These variants will be tracked in Permutive.

You can set up a variant by clicking '+ Add Variant' and repeating the steps above. 

Variants are tracked in the A/B testing, and the dashboard will display conversion rates for each variant.

Above is an example of an overlay A/B/C test, with results.

Context Criteria

Context criteria is a way of limiting who sees the effect of the script based on their current context. This could be their url, location, referrer etc. You can set context variables in JavaScript, then reference them in your reaction. 

Writing the JS usually requires a developer, so it's best to get in touch with us first to guide you through the process.

Did this answer your question?