Custom variable wrongly getting updated

We are capturing EmployeeID in our web page using piwik custom variable option.

Here is my code,

var _paq = _paq || [];
    (function () {
        var u = (("https:" == document.location.protocol) ? "URL" : "URL");
    	_paq.push(['setSiteId', '3']);
        _paq.push(['setTrackerUrl', u + 'piwik.php']);
   	_paq.push(['setCustomVariable', '1', 'EmployeeID', '123456', 'visit']);
	_paq.push([function () {
	var customVariable = this.getCustomVariable(1);
        } ]);


        var d = document,
    	g = d.createElement('script'),
        s = d.getElementsByTagName('script')[0];
        g.type = 'text/javascript';
    	g.defer = true;
        g.async = true;
    	g.src = u + 'piwik.js';
        s.parentNode.insertBefore(g, s);

And execute the following query in mysql to view visit log info.


SELECT LV.custom_var_v1 AS EmployeeID, LV.*
FROM piwik_log_visit LV
WHERE LV.idsite=3 AND LV.custom_var_v1 = 123456 ORDER BY LV.idvisit DESC;

But after few minutes the EmployeeID is updated wrongly in piwik_log_visit table’s “custom_var_v1” field with different EmployeeID for the same idvisit.

What is the data before the problematic update, and after? what is your JS code?

Hi Matt,

Thank you very much for your swift response.

We believe this is resolved. Our servers are behind proxy, so made recommended setting in config fie.

Once again thank you.