How to track clicks on javascript function?


Hi there! Tried everything, but still can’t figure out how to track clicks on a code that I have. The code goes like this:

<script type="text/javascript" charset="UTF-8"> (function(){ document.write("<script src='' charset='UTF-8' type='text/javascript'><"+"/script>"); })(); </script>

It’s a code of a affiliate program needed for popup. I want to track the clicks on it, but whatever I try, nothing is counted. Any help/advices?

(vipsoft) #2

After you load the popup, you have to attach a click handler. Something like this in jquery:

var tag = $('div.popup-pop-over'); {
    piwikTracker.trackLink(tag.attr('href'), 'link');

(Matthieu Aubry) #3

Btw if you come up with a easy reusable snippet please let us know and we will add it to doc :slight_smile: