Custom variable problem

I am using the piwik custom variable on a page

I have linked each variable to a specific javascript event

However every event is logged twice or sometimes even more.


function linksport(){

function linkNature(){

It seems that when I am using the _paq.push([‘trackPageView’]); , it just aggregating the events rather then pushing them and flushing the queue of events.

Did anyone bump into this problem?

Am I doing something wrong here?