Quantcast
Channel: Piwik Forums - Support & Bugs
Viewing all articles
Browse latest Browse all 4243

Setting userId throws a JS error (no replies)

$
0
0
VersionL 2.6.1
I am trying to pass a userId from JS tracking code.
However I am getting the JS error below.
The error does not happen if I am not setting the userId.

Uncaught TypeError: Cannot read property 'apply' of undefined piwik.js:14

javascript tracking code snippet:

var _paq = _paq || [];
        _paq.push(["setCustomVariable", 2, "Session", "${session?.id}", "visit"]);
      
       _paq.push(['setUserId', 'USER_ID_HERE']);
       
       _paq.push(["trackPageView"]);
        _paq.push(["enableLinkTracking"]);

        (function () {...}

Viewing all articles
Browse latest Browse all 4243

Trending Articles