Forum Moderators: open
Got a quick question for a javascript expert that has me stumped. I am trying to track some campaigns on a site with a keyword tracking tool called keywordmax. It utilizes a standard single pixel tracking script to track clicks through to the landing pages.
I have been having trouble getting this to work. I spoke with the vendor, and they investigated and determined there was a script on the page that was interferring with their tracking tool. (They mirrored the site and discovered their tool worked as long as this code was removed...)
If anyone can shed some insight on to why this might be happening, as well as what could potentially be done to fix it -- that would be great. Thanks.
Here is the code on the site that appears to be causing the issue:
<script LANGUAGE="JavaScript">
<!--
var top=70
var br
if(navigator.appName == 'Netscape' && document.layers!= null){br="N";}
else if(navigator.appName == 'Microsoft Internet Explorer' && document.all!= null){br="IE";}
else{br=null}
//-->
</script>-->
As adni18 suggests, changing variable names might have an effect, but you would need to make sure all the related invocations of that variable are synchronized.
1. Yes. Change the variable names. Most definately top. Using this as a global variable name makes
window.top (points to top frame in heirarchy, or window itself) unavailable. Who knows, it may be needed. 2. The browser sniffer is very old. It the variable to null for essentially all browsers apart from Internet Explorer, since the only other option is Netscape 4 (document.layers).