Custom Variables in Piwik 2.3.0-piwik is not defined


#1

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~~


#2

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”
]);


(Matthieu Aubry) #3

can you paste the complete code?


#4

Yes, please kindly find the following code


#5

Also, here is the debug result of the _paq,
Please kindly help


#6

This problem is resolved

It is caused by missing the following code at the end of _paq.push([‘setCustomVariable’,…

_paq.push([‘trackPageView’]);