Skip to content

Instantly share code, notes, and snippets.

@RobertCam
Last active March 30, 2021 15:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobertCam/19422998c8c27f4affd1b1cda2eb3b4a to your computer and use it in GitHub Desktop.
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
<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