nodebb-plugin-google-analytics: Where does the Google code get loaded (to make Piwik better)?



  • For those of you keeping score I worked out getting my Piwik (website analytics) javascript installed onto my forum. I also have the Google Analytics plugin installed. The Google Analytics tracking is doing a better job than the Piwik is. Piwik isn't capturing all of the traffic. For example it never seems to see the activity when someone registers (/register url) but Google does see it.

    I have my Piwik javascript in the Appearance > Custom HTML & CSS > Custom Header area. Where is the the Google Analytics javascript? If I navigate to one of my forum pages and look at the page source I see my Piwik javascript but not the Google javascript. That leads me to think the GA js is being side-loaded and is possibly more efficient that way then using the header in html.

    What I'd like to test is to load my custom Piwik javascript in the file that loads the GA javascript to see if Piwik then catches more of the site activity (like Google seems to.)

    Thank you.


  • Plugin & Theme Dev

    @rod it's a plugin, so the code will be included in nodebb.min.js



  • @pichalite I found the file in /public. Is that file autogenerated each time Nodebb is started, reloaded or restarted?


  • Plugin & Theme Dev

    @rod yes



  • @pichalite Would you happen to know where I would find the code from the plugin that gets included in nodebb.min.js? I'd like to see if I could drop my Piwik javascript in there to get rolled up into nodebb.min.js as well.



  • I may have found it. node_modules/nodebb-plugin-google-analytics/lib/client.js looks promising. But ohhzzmyyygeez wtf. I don't know how all of that constructs the js call for GA.


Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.