PDA

View Full Version : Getting Google analytics to exclude traffic using cookie


masten
03-12-2009, 10:11 AM
Im using fppanalytics to track my tours but need to exclude my clients from the stats. IP address masking no good as most seem to be dynamic.

So Im trying to use the cookie method. But cannot get it to work. Has anybody here successfuly got it to work? Have tried loads of stuff Ive found on the web but with no joy.

cheers

Masten

allSaints
03-12-2009, 11:50 AM
Hi Masten,

I suppose the tracking is done in some javascript function, and in that case something like the code below could work:

<script language="JavaScript">
<!--
if (checkCookie("name_of_cookie") == "1") {
do_your_tracker_stuff
}

function checkCookie(cookieName) {
var theCookie = ""+document.cookie;
var ind = theCookie.indexOf(cookieName);
if (ind == -1 || cookieName == "")
return "0";
else
return "1";
}
//-->
</script>




Tommy