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 () {...}
matthieu
(Matthieu Aubry)
September 23, 2014, 11:50pm
2
setUserId was added in Piwik 2.7.0-rc1 please download from: Index of /
Would be great if the manual said which version introduced each feature so that it makes debugging easier.
matthieu
(Matthieu Aubry)
September 24, 2014, 10:47am
4
Yes sorry about that! Piwik 2.7.0 was released today!
Oh sweet! But yea, I agree with @thefoodcorp you should tell us that in the docs.
OK it is working now. However, how do I create a segment to search by user id only?
I tried this:
but no luck
matthieu
(Matthieu Aubry)
September 24, 2014, 10:30pm
7
yes this should work! isnt it working for you?
nope. i keep getting There is no data for this report.
matthieu
(Matthieu Aubry)
September 26, 2014, 3:22am
9
but before you were getting Uncaught TypeError: Cannot read property 'apply' of undefined piwik.js:14
so it’s a different problem? see Piwik doesn’t track any visits and pages, and shows “There is no data for this report” in all reports. - Analytics Platform - Matomo