View Single Post
  #3 (permalink)  
Old 04-11-06, 01:25 AM
w2n's Avatar
w2n w2n is offline
Newbie Coder
 
Join Date: Jan 2006
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,

First of all, a big thanks for the reply, with the full code!

However, I have tried it with a plain HTML file, with some links! NO link is being tracked with your code!

Here is what my file is looking like...

Code:
<base target="_blank">

<table width="593"  border="0"><tr><td width="50" valign="top"><p style="clear: both"><div class="pr">PR: 8<div class="prg"><div class="prb" style="width: 32px"></div></div></div></p></td><td width="543"><p><a id="3" href="http://www.wikipedia.com"><strong>Pellentesque lectus felis</strong></a><br />Donec eu felis et leo consectetuer elementum. Vivamus nec metus quis sapien aliquam convallis. Sed quam. Ut sit amet orci. Aliquam mattis auctor sapien. Donec aliquam varius odio. Fusce malesuada, felis sit amet tristique adipiscing, risus risus tincidunt<br /><span class="url">http://www.wikipedia.com<br /></span><br /></p></td></tr></table>

<table width="593"  border="0"><tr><td width="50" valign="top"><p style="clear: both"><div class="pr">PR: 7<div class="prg"><div class="prb" style="width: 28px"></div></div></div></p></td><td width="543"><p><a id="5" href="http://www.bbc.com"><strong>Pellentesque habitant tristique</strong></a><br />Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc hendrerit pretium enim. Fusce tempus ornare justo. Sed neque elit, tincidunt in, iaculis et, facilisis in, nunc. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vivamus eu ante vitae<br /><span class="url">http://www.bbc.com<br /></span><br /></p></td></tr></table>

</div>

<script>
document.onload=function findAllLinks(){
	var exclude=["domainA.com","domainB.com"] // This is the array you modify

	var excludeRegExp=new RegExp(exclude.join("|"),"i") // This generates a regular expression based on the excluded domains.
	var links=document.getElementsByTagName('a')  // Get all the links
	for(var link=0;link<links.length;link++){
		if(!excludeRegExp.test(links[link])){ // If none of the domains in the RegExp exists in the URL, modify the link.
			links[link].href="http://url.w2n.net/*"+links[link].href  // Prepend the clicktracker.
		}
	}
}
</script>

If you click either of these 2 links, none of these are being tracked, by the tracking script! It's not a fault of the tracking script, because, it's 100% working otherwise! If you click the links, it is opening as the direct URL, not via the tracking URL.

By the way, the tracking URL (http://url.w2n.net/*) looks like...

For Google.com: http://url.w2n.net/*http://www.google.com

Please help, if possible!

Thanks again...

__________________
SWAGATO GANGOPADHYAY
Founder/Owner/CEO
The Rozaleenda Group, Inc.


Reply With Quote