How to Redirect Visitor When Optin is Closed

OptinMonster’s Javascript Events API allows us to extend the functionality of optins to suit a number of custom needs.

While you can configure a Redirect URL for the optin when successfully submitted through the optin builder, you can also redirect the visitor when the optin is closed following this guide should you have a specific need for this functionality.

Any Javascript can be added to the <head> or footer of your site.

Remember to place your code in <script> tags, for example:
<script type="text/javascript">
   // Your JavaScript here..
</script>

Redirect All Optins on Close

Redirect the visitor to a specific URL when any optin on the site is closed.

Replace http://optinmonster.com with your own redirect url.


Redirect Specific Optin on Close

Redirect the visitor to a specific URL when a specific optin on the site is closed. Replace http://optinmonster.com with your own redirect url, and YOUR_OPTIN_SLUG_HERE with the slug of your optin.


FAQs

Q: What about Custom HTML Integrations or Canvas?

A: The Custom HTML integration and Canvas are able to use this as long you have the om-trigger-conversion class applied. Follow our guide on using the custom conversion class with Custom HTML integrations or with Canvas optins.