It is currently Fri Jul 30, 2010 10:46 pm


Free adSense space Give-Away




Post new topic Reply to topic  [ 9 posts ] 
Automatic tracking of outbound links? 
Author Message

Joined: Fri Feb 06, 2009 3:31 pm
Posts: 9
Post Automatic tracking of outbound links?
I'm fed up with having to place a _trackPageview() in every outbound link on my websites... Does anybody know about a work around. I know MS does this automatically.

Why doesn't Google offer this. (At least nothing I can find..)

thanks in advance


Fri Feb 06, 2009 4:12 pm
Profile

Joined: Sat Jan 24, 2009 9:07 pm
Posts: 25
Post Re: Automatic tracking of outbound links?
Can't you do something with search and replace in dreamweaver or notepad?? Or is you use php you might be able to add it in your cms or somthing. Ther also might be automatic link parsers for your pages that automatically insert the code in the backend.

Good luck!


Fri Feb 06, 2009 4:20 pm
Profile

Joined: Sat Jan 24, 2009 9:07 pm
Posts: 25
Post Re: Automatic tracking of outbound links?
OR...
Just get MS Analytics for all your sites!

Why are you using Google anyway?


Fri Feb 06, 2009 4:21 pm
Profile

Joined: Fri Feb 06, 2009 3:31 pm
Posts: 9
Post Re: Automatic tracking of outbound links?
I still use GA, because I have al lot off data in those accounts. I don't even know if I will swithc over entirely. I use both tracker codes on most pages. But GA does seem to be the tool I use most. Don't really know why. Porbably becaus I'm used to it.

Oh.. I do use dreamweaver find-and-replace, but this is rather tedious as well. I can't imagine there is no other way.


Fri Feb 06, 2009 4:24 pm
Profile
Site Admin

Joined: Sat Jan 24, 2009 3:17 pm
Posts: 131
Post Re: Automatic tracking of outbound links?
I think there is a way cayunbos. I remember it from some time back. It was some kinda Javascript code, just like MS offers in their standard package. Let me do a search through my bookmarks....

_________________
MS Analytics Forum Administrator


Fri Feb 06, 2009 4:40 pm
Profile

Joined: Sun Jan 25, 2009 2:15 am
Posts: 18
Post Re: Automatic tracking of outbound links?
I'm interested as well. Keep us posted Admin.


Fri Feb 06, 2009 4:55 pm
Profile
Site Admin

Joined: Sat Jan 24, 2009 3:17 pm
Posts: 131
Post Re: Automatic tracking of outbound links?
Yup, found it!

It's posted on this site: http://www.jhuskisson.com/code-tidbits/ ... omatically
but I'll give a quick overview...

Basically you have to paste the following code behind the normal ga.js tracker code, you get from google

the code:
Code:
<script type=”text/javascript”>
if (document.getElementsByTagName) {
var ahrefs = document.getElementsByTagName(’a');
for (var i=0; i<ahrefs.length;i++) {
if (ahrefs[i].href.indexOf(’http://www.domain.com’) == -1 && !ahrefs[i].onclick) {
ahrefs[i].onclick = function () {
pageTracker._trackPageview(’/outbound/’+this.href.substring(7));}
}}}
</script>

Then change the damain and you should be set. It will parse your fila and attach the _trackPageview to each link. Then in GA you will get the outbound links as:
yoursite.com/outbound/www.the-outbound-url.com

So it will not replicate the outbound link excatly but with some smart segmentation you can see how many hits the outbound folder gets and then to which url they go.

For the old urchin google code, urchinTracker, there's this version (but you should probably upgrade, if you still have the old version):
Code:
<script type=”text/javascript”>
if (document.getElementsByTagName) {
var ahrefs = document.getElementsByTagName(’a');
for (var i=0; i<ahrefs.length;i++) {
if (ahrefs[i].href.indexOf(’http://www.yourdoamin.com‘) == -1 && !ahrefs[i].onclick) {
ahrefs[i].onclick = function () { var track = this.href + ”; urchinTracker (’/outbound/’+track.substring(7)); }
}}}
</script>


Hope this helps, and tell me if it really works!

_________________
MS Analytics Forum Administrator


Fri Feb 06, 2009 5:16 pm
Profile

Joined: Fri Feb 06, 2009 3:31 pm
Posts: 9
Post Re: Automatic tracking of outbound links?
Awesome!!!!! Thank you so much for this.

So I need to add this after the gs.js script?
At the end of the page? Is that ok?


Fri Feb 06, 2009 7:18 pm
Profile
Site Admin

Joined: Sat Jan 24, 2009 3:17 pm
Posts: 131
Post Re: Automatic tracking of outbound links?
Yeah that's ok. Just behind the ga.js and before the </body> tag!

_________________
MS Analytics Forum Administrator


Fri Feb 06, 2009 7:22 pm
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © phpBB Group.

phpBB SEO