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.
Step 1 – What Triggers a Success Event?
When editing your campaign in the Campaign Builder, you can go to the Success Panel. There you should see a field called Success Triggered Scripts.
You can ensure the Success Event is fired by having your submit button be an input element that has the
To summarize, your HTML which will trigger the success script should look similar to the following:
<input type="submit" class="om-trigger-conversion" value="Click Here!" />
Step 2 – Add Script Tags
Congratulations, you’re ready to go with your Success Triggered Scripts. Check out our Testing Guide to confirm everything works as you expect.
Let’s say you wanted to grab the values that were entered into your Native Integration to use for another purpose.
You can grab the code by doing something like the following, which will display the values into the console:
<script> console.log('The name is: ' + jQuery('#om-yjujjtod8wruqb2js8sw input.omaha-field-name').val()); console.log('The email is: ' + jQuery('#om-yjujjtod8wruqb2js8sw input.omaha-field-email').val()); </script>
Frequently Asked Questions
Q: Is there a way track a conversion but not track cookies and run the success event?
A: Yes, if you don’t want any cookies set for an alert such as a floating bar that shows information, you use Custom HTML. However, for tracking conversions this way, you will add the class
om-trigger-alt-conversion. So a link could look like:
<a href='https://optinmonster.com' class='om-trigger-alt-conversion'>Check out OptinMonster!</a>
This class will also bypass the success function and not set cookies as well, including not setting any global cookies, etc.