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 mix 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.

On Entry / On Exit / Every Time: When you want the overlay to be displayed. On entry to a segment, when a user exits a segment, or every time they visit a page while in that segment.

Variants: Covered in Reporting below

Context Criteria: Explained below


When using the Script Runner, you can track impressions and conversions for the reaction. You can track impressions and conversions using impression() and conversion() in your script. It's up to you to decide what an impression and conversion mean,


If you want to test a script to 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' then setting up your variant in the same way as you set up your initial overlay.

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 an overlay based on their current context. This could be their url, location, referrer, IP address 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?