Forum Moderators: martinibuster
function TrackIt() {
if (window.status.indexOf('go to') == 0)
{
docref='na';
AdvertiserDomain='';
PageLocation='';
if (document.referer) docref=escape(document.referer)
if (window.status) AdvertiserDomain=escape(window.status.substring(6))
if (document.location) PageLocation=escape(document.location)
bug = new Image();
bug.src = 'trackScript.dll?loc=' + PageLocation + '&ad=' + AdvertiserDomain + '&r=' + docref ;
}
}
var elements;
elements = document.getElementsByTagName("iframe");
for (var i = 0; i < elements.length; i++) {
if(elements[i].src.indexOf('googlesyndication.com') > -1)
{
elements[i].onfocus = TrackIt;
}
} I wonder if I am the only guy who never got the value of the referer. Please help, thanks!
[edited by: zhenghua at 12:23 am (utc) on Mar. 14, 2004]
Aaron
You should try putting a Session cookie with the referrer on each page, then use the cookie to identify the referrer for each page when you write the click to your log file.
That would be the quick and easy solution.
<script language="JavaScript" type="text/javascript">
<!--
if (document.referer) _ref=escape(document.referer)
//-->
</script>
<script type="text/javascript" src="/javascript/AdsenseTracking.js"></script>
Then, at the AdsenseTracking.js, do some modification as follows:
...
if (document.referer) docref=escape(document.referer)
if (window.status) AdvertiserDomain=escape(window.status.substring(6)) ...
[devedge.netscape.com...]
Otherwise, the document.referer cannot or can transfer to the linked .js?