setCustomVariable with async tracking code


(Xaver) #1

I like to inlcude some custom data in my async tracking code.

I try


_paq.push(['setCustomVariable',1,'key' 'value'])

but doesn’t work. I get a


aU.slice is not a function

error with firebug

any suggestions?


(vipsoft) #2

Works for me if I insert a comma (,) between ‘key’ and ‘value’.


(Xaver) #3

This is my actual code:


_paq.push(['setSiteId', 106],['setTrackerUrl', u+'piwik.php']);
_paq.push(['setCustomVariable',1,'iframe',(top.location != self.location)]);
_paq.push(['trackPageView']);

I want to check if it is open in an iframe.

I forgot the comma in the post


(Xaver) #4

It seems the third parameter has to be a string


_paq.push(['setCustomVariable',1,'iframe',""+(top.location != self.location)]);

works for me