I want to add a custom variables in Piwik 2.3.0, while the error-‘piwik is not defined’ goes out with following tracking code.
Please kindly help~~
I change the code to be following and no error comes out, but still cannot find the Custom Variables in Dashboard,
_paq.push([‘setTrackerUrl’, u+‘piwik.php’]);
_paq.push([‘setSiteId’, 1]);
_paq.push([‘setCustomVariable’, 1, “username”, getCookie(“user”), //this is a function for getting the username from cookie.
“visit”
]);
can you paste the complete code?
Yes, please kindly find the following code
Also, here is the debug result of the _paq,
Please kindly help
This problem is resolved
It is caused by missing the following code at the end of _paq.push([‘setCustomVariable’,…
_paq.push([‘trackPageView’]);