Last active
March 30, 2021 15:45
-
-
Save RobertCam/19422998c8c27f4affd1b1cda2eb3b4a to your computer and use it in GitHub Desktop.
Prevent a script from firing on an Unbounce page based on a URL
This file contains 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
<script> | |
// Script will NOT fire on URLs containing "check" | |
// Change the below variable to look for a different string in the URL (You can add an entire URL) | |
var excludeFromSM = "check"; | |
if (document.location.href.indexOf(excludeFromSM) === -1){ | |
// Your code goes here | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment