Custom JS is not working for me
-
I’m trying to put a value in local storage so that the popup will not reopen until the user returns to the site with a new browser instance. Here is the code I’ve put in the box labeled “Opening events: #1 Add the code you want to run before the popup opening.”
if (window.localStorage.getItem("randomfakeid") == null) { return true; }
Here is the code I’ve put in the box labeled “Closing events: #2 Add the code you want to run before the popup closes.”
window.localStorage.setItem("randomfakeid", true);
I think this should put a key/value in the user’s browser when the popup closes, check for the value before opening the popup, and prevent the popup from open if the value exists. Nothing has changed, however, and the popup still opens on every page no matter how many times I close it.
- The topic ‘Custom JS is not working for me’ is closed to new replies.