How to count all clicks on your blog with TradePulse

Posted by MMagery on Friday Jan 15, 2010 Under Software, TradePulse

With this simple script, all clicks on your blog will be tracked by TradePulse so you can even see how productive your traffic is what is VERY hard to do when integrating trade script and WordPress and similar blog content management systems. So surfer will see normal link, when he clicks his click will go thru TradePulse 100% to content by default or you can change parameter to fit your needs and it will even save outgoing domain to which you link in links statistics of TradePulse. So you need to add couple lines of JS code:

<script>
$(document).ready(function(){
$("a").click(function(){
url=$(this).attr('href');
if (url.match(/^http(s)?:\/\//i)){
path=url.replace(/^http(s)?:\/\/(www\.)?/i,'').split(/\//);
$(this).attr('href','/tp/out.php?link=' + path[0] + '&p=100&url=' + escape(url));
}
});
});
</script>

* Script will not track links without http and www inside, so you can use still normal toplists and get them working thru TradePulse, so for example if you have link <a href=”/some/file.php”> this script wont push it thru tp, but if it’s <a href=”http://www.domain.com/some/file.php”> click will be pushed thru TP.
* You need to use JQUERY for this to work, you can download it here: http://docs.jquery.com/Downloading_jQuery and you can see instructions how to setup it here: http://docs.jquery.com/How_jQuery_Works.

You can download free version of Trade Pulse here.

Leave a Reply