Skip to content

Instantly share code, notes, and snippets.

@tfayyaz
Last active August 29, 2015 14:00
Show Gist options
  • Save tfayyaz/11099857 to your computer and use it in GitHub Desktop.
Save tfayyaz/11099857 to your computer and use it in GitHub Desktop.
(function(){
var currentTags = document.getElementsByTagName('script');
var noTags = currentTags.length;
var gaTagsFound = []
for (var i = 0; i < noTags; i++) {
if (currentTags[i].innerText.indexOf('_gaq.push([\'_setAccount\', \'UA-12457755-1\'])') > -1){
gaTagsFound.push(i)
// console.log(i);
// console.log(currentTags[i].innerText)
}
}
// console.log(gaTagsFound)
// console.log(gaTagsFound.length)
if (gaTagsFound.length > 0) {
return true;
} else {
return false;
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment