@baris Got it! Thank you. So much to learn about javascript. Now I am off to figure out why I am not seeing the user id being reported in Piwik. As an aside I had tried the suggestion you made a few days ago but without seeing a noticeable change in the Piwik reporting and not seeing the user id in the html page source I thought I had setup the line incorrectly.
rod
Posts
-
Getting Logged In User - Javascript for Piwik -
Getting Logged In User - Javascript for Piwik@baris Thank you for the advice. I gave your suggestion a try and it does not seem to work. The app.user.uid is not being converted into the actual userid. When I look at the page source, after visiting the page, I see this:
(...) <script type="text/javascript"> var _paq = _paq || []; _paq.push(['setUserId', app.user.uid]); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { (...)
As you can see app.user.uid was not replaced with my actual user id. Do you have another possible suggestion?
Thank you.
-
nodeBBAn interview with Andrew Rodrigues, Julian Lam and Barış Soner Uşaklı:
"I guess the NodeBB name is kind of a tribute to phpBB from a lot of fond memories in that space."
-
Getting Logged In User - Javascript for PiwikI 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.