Skip to content

Instantly share code, notes, and snippets.

@ericakfranz
Created February 6, 2023 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericakfranz/2d555ddd385753bcef5f654c401a2fae to your computer and use it in GitHub Desktop.
Save ericakfranz/2d555ddd385753bcef5f654c401a2fae to your computer and use it in GitHub Desktop.
Limit OM Campaigns
/**
* Limit OptinMonster Campaigns
* @author Erica Franz
* @url https://fatpony.me
* @desc Show only one OptinMonster campaign per page visit regardless of campaign type.
*/
// Run this script when the first Campaign is shown
document.addEventListener('om.Campaign.afterShow', function(event) {
// Locate and remove only empty HTML placeholders for campaigns
document.querySelectorAll('[id^=om-][id$=-holder]:empty').forEach(e => e.remove());
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment