Custom triggers allow you to run experiments in situations where the default VWO trigger conditions are ineffective. 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
Suppose a user has added $200 worth of products to his shopping cart and leaves the checkout page without purchasing. As a marketer, you'd be interested in learning the cause of such behaviour. The following code will execute the trigger if the order value is greater than $100.
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. The following code will execute the trigger if a goal is converted for an existing campaign.
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 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.
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. The following code will execute the trigger if a particular variation from an existing campaign in VWO is displayed.
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.