OptinMonster allows you to use any Email Service Provider or fully customize your optin forms using our Custom HTML Optin Form integration option. Now you can easily set cookies and track conversions when using a custom html form.
In order to facilitate this, there is a special class that you can use to notify OptinMonster that a conversion has happened. All you need to do is add the class
om-trigger-conversion to the custom html form’s submit button.
<form method="POST" src="http://www.example.com/form.php"> <input type="text" placeholder="First Name" /> <input type="email" placeholder="Email Address" /> <input type="submit" class="om-trigger-conversion" value="Submit Now!" /> </form>
This lets us know that a conversion has taken place when the visitor selects the submit button in your custom HTML form, and also sets a cookie if you’ve specified a Cookie Duration value for your optin.
We hope this guide helped you track conversions when using a custom HTML form. You may also want to check out our tracking conversions in Canvas documentation to setup conversion tracking with our Canvas Technology!
Q: Why does my optin not close automatically after submission?
A: For most users, their form’s redirect action renders this a non-issue. However, if your code keeps the web visitor on the same page, then you will need to add an additional class to your input. You will need to add the
What this means is your Submit input button will now have 2 custom classes: (1) the
om-trigger-conversion to track a conversion when the button is pressed, and (2) the
om-trigger-close to close the optin modal popup when the conversion data has been submitted.
<input type="submit" class="om-trigger-conversion om-trigger-close" value="Sign me up!" />