I have recently deployed a Piwik installation for my Nodebb forum site. I wish to analyze my traffic by the logged in Nodebb users. According to the Piwik documentation I need to pass the userid information in my tracking javascript code like this:
_paq.push(['setUserId', 'USER_ID_HERE']);
I have been searching around and found that I may have to use the app.user object from NodeBB. But how? Would someone help me construct the javascript code to put the NodeBB user (or userid) into a variable that I could then use in the _paq.push... that I listed above?
Edit: Let me add that I am passing the Piwik javascript tracker code via the "Custom HTML & CSS > Custom Header" area. The generic Piwik Javascrip does work I just wish to add the additional component of the user if one is logged in.
Thank you.