How to Redirect Visitor When Campaign is Closed

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

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

Any Javascript can be added to the header or footer of your site.

Remember to place your code in <script> tags

Redirect All Campaign on Close

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

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

Redirect Specific Campaign on Close

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


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 campaigns.