Created
February 6, 2023 23:37
-
-
Save ericakfranz/2d555ddd385753bcef5f654c401a2fae to your computer and use it in GitHub Desktop.
Limit OM Campaigns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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