Skip to content

Instantly share code, notes, and snippets.

@robisatthefunction
Created January 11, 2019 18:41
Show Gist options
  • Select an option

  • Save robisatthefunction/bda8c1760ec6f60cb0b4b679ade60cc5 to your computer and use it in GitHub Desktop.

Select an option

Save robisatthefunction/bda8c1760ec6f60cb0b4b679ade60cc5 to your computer and use it in GitHub Desktop.
/**
* Sample JavaScript Condition
* This function is called after the page is triggered. It should return true
* when the page is ready to activate.
*/
function () {
var bucket = false;
for (var i=0; i<window.dataLayer.length; i++) {
if (window.dataLayer[i].subProgramName === "Fall Individuals") {
bucket = true;
}
if (window.dataLayer[i].subProgramName === "Spring Individuals") {
bucket = true;
}
if (window.dataLayer[i].subProgramName === "Sports") {
return false;
}
}
return bucket;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment