Google Blogoscoped

Forum

Google Analytics & Misplacing Code

/pd [PersonRank 10]

Wednesday, August 30, 2006
17 years ago2,238 views

FYI stuff only :)-

http://www.seroundtable.com/archives/006023.html

Tony Ruscoe [PersonRank 10]

17 years ago #

I think one way around this *could* be to modify your code as follows (replacing the # with your own code and "example.com" with your domain):

<script type="text/javascript">
_uacct="UA-######-#";
_udn="example.com";
urchinTracker();
</script>

This would try to force a cookie for that domain, which wouldn't work on another domain. I'm not sure whether this would still register a page view and just not cookie the user though. (And this wouldn't stop someone just copying and pasting your code and removing the _udn parameter.)

Another way to keep your reports clean would be to setup filters that filter out any domains that aren't yours. Having said that, I don't think you should be expected to do this!

Perhaps this was done intentionally for people who serve their website on multiple domains and wish to use the same tracking code across all of them? (The cookies wouldn't work cross-domain but they would work fine if people consistently used the same domain each time they visited sites that do this.)

Tony Ruscoe [PersonRank 10]

17 years ago #

(Interestingly, leaving the same comment on seroundtable.com would've tried to execute that JavaScript code, so I had to HTML encode the tags. This means they're leaving their site open to a bit of XSS...)

/pd [PersonRank 10]

17 years ago #

exactly Tony ..... a lot more XSS stuff can be expliotable :)-

Forum home

Advertisement

 
Blog  |  Forum     more >> Archive | Feed | Google's blogs | About
Advertisement

 

This site unofficially covers Google™ and more with some rights reserved. Join our forum!