One problem about trackLink()


(cn_Dark) #1

I add trackLink() in my js tracking code

<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://localhost/piwik/" : "http://localhost/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();

var cus2 = {
'reference_commande' : 'a2e_2',
'email_client' : 'client@mail.com',
'idclient' : '2189'
};

piwikTracker.trackLink('','eCommerce', cus2);
} catch( err ) {}
</script><noscript><p><img src="http://localhost/piwik/piwik.php?idsite=1" style="border:0" alt=""/></p></noscript>
<!-- End Piwik Tag -->

If I visit the page with this code, problem occurs, in databse piwik_log_visit, there will be two rows inserted:
[attachment=63:sql.php.htm]
You can see in this table, idvisit 4 and 5, in fact , it is only one visit, and tracklink() is logged as idvisit 4, it can not log some datas such as referer_url , config_resolution, etc.