Skip to content

Instantly share code, notes, and snippets.

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 marklchaves/14ccdbb93872db196dbf298037cc3fc2 to your computer and use it in GitHub Desktop.
Save marklchaves/14ccdbb93872db196dbf298037cc3fc2 to your computer and use it in GitHub Desktop.
Prompt for a popup ID number and then display the trigger settings for that popup ID in a table format.
const popupID = prompt("What's the popup ID number?");
if (typeof PUM !== 'undefined') {
let triggers = PUM.getSettings(popupID).triggers[0];
if (typeof triggers !== 'undefined') {
console.log(`%cTrigger Settings for Popup ID ${popupID}`,
"color: #b92099; font-size: 20px;");
console.table(triggers); // Triggers
if (typeof triggers.settings !== 'undefined') {
console.table(triggers.settings); // Cookies
//console.table(PUM.getSettings(input).triggers[0][1].settings); // Displays cookie name`
}
} else {
console.log(`%cGot nothing. Are you sure "${popupID}" the right popup ID number?`,
"color: firebrick; font-size: 18px;");
}
} else {
console.log('No Popup Maker popups here. Is Popup Maker running on this page?')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment