Custom triggers help you implement surveys where regular the default VWO trigger conditions don't help. The following examples are some unique cases that require the flexibility and power that the custom trigger offers:
- Triggers for Shopping Cart Abandonment
- When a Goal Conversion is successfully recorded
- A survey targeting specific variation
Example 1: Shopping Cart Abandonment
If a user has said, $200 worth of products in their shopping cart and is leaving the checkout page without making the purchase. As a marketer, you'd be interested in learning the cause of such behavior. The following code will execute the trigger if the order value is greater than $100.
function() {
$(document).ready(function(){ if($("label.order-value").text() >= 100) { //Call this method to show the survey executeTrigger(); } }); }
Example 2: Successful Goal Conversion
If you want to show the survey when a goal from an existing campaign in VWO is executed, you can use the following code in the custom trigger.
Example Code: This code will execute the trigger if a goal is converted for an existing campaign in the
VWO function()
{ window.VWO = window.VWO || []; VWO.push(['onGoalTrigger', CAMPAIGN_ID, GOAL_ID, function () { executeTrigger(); }]) }
Replace CAMPAIGN_ID and GOAL_ID with your campaign id, goal id, and variation id. Goal ids are available in the report against each goal name. So goal G1 has goal id of 1, goal G2 has an id of 2, and so on. Variations ids too, are available in the report against the variation names. So variation v1 has a variation id of v2 (Control has the variation id of 1), and so on.
Example 3: For Specific Variation
If you want to target a specific survey to a specific variation of a campaign, use the following code in the custom trigger.
Example Code: This code will execute the trigger if a particular variation from an existing campaign in VWO is displayed
function() { window.VWO = window.VWO || []; VWO.push(['onVariationShown', CAMPAIGN_ID, VARIATION_ID, function () { executeTrigger(); }]) }
Replace CAMPAIGN_ID, GOAL_ID, and VARIATION_ID with your campaign id, goal id, and variation id. Goal ids are available in the report against each goal name. So goal G1 has a goal id of 1, goal G2 has an id of 2, and so on. Variations ids too, are available in the report against the variation names. So variation v1 has a variation id of v2 (Control has the variation id of 1), and so on.