How to Use Success Triggered Scripts

Do you have a script you would like to run when someone completes a campaign of yours? Would you like to fire an independent tracking pixel from Facebook or Pinterest? Our Success Triggered Scripts make this easy to accomplish.

  1. What Triggers a Success Event?
  2. Add Script Tags
REQUIREMENTS: This feature requires a Growth subscription.
REQUIREMENTS: This guide presumes you’ve read and understood the Creating Your First Campaign guide and that your campaign is already on your site.

Step 1 – What Triggers a Success Event?

When editing your campaign in the Campaign Builder, you can edit the Action settings of a form or button element.

Action Panel

From there, you can use the scripts box at the bottom. This block will run when the button is clicked or the form is submitted.

Success Scripts

NOTE: Actions are unique to each element. If you want the script to run for multiple elements, you will need to add it to each element’s action individually.

Step 2 – Add Script Tags

All JavaScript needs to be wrapped in script tags, no matter where you’re placing your Scripts within OptinMonster. Therefore, if you are using the Success Triggered Scripts then you also need to have it within Script Tags.

// Your JavaScript here

Congratulations, you’re ready to go with your Success Triggered Scripts. Check out our Testing Guide to confirm everything works as you expect.