Targeting Experiments and Firing Goals Based on a JS Condition

Target Based on Javascript Condition

You might want to fire a conversion or run an experiment when some sort of JavaScript expression evaluates to "true". 

This DMP (Data Management Platform) feature allows it to target for example lead score/stage from your Marketing Automation tool (like Marketo, Pardot, Elequou, Hubspot or Salesforce) without too many efforts.

Important Note: Any JavaScript used inside the expression has to be defined before the main Convert Experiments tracking code. If they are defined later on the page, their values cannot be used at the time of evaluation and the condition might not be matched;

Note: The javascript expression will be evaluated into the global "window" context; 

Currently, it's possible to use the Javascript expression targeting in three locations:

  1. Advanced Goal Setup; a goal can be fired if the javascript condition used evaluates to true:
  2. Experiment Site Area; you can run an experiment on pages where a certain Javascript condition evaluates true:
  3. Experiment Audience: You can run an experiment for a certain group of visitors. For example, if one has a certain JavaScript variable holding the visitor status (client or anonymous), then it would be possible to run an experiment only for clients:

Keywords: trigger goal, trigger conversion

Have more questions? Submit a request