Can't get Google Analytics to work
-
I'm aware that there's a Google Analytics plugin by @julian, but after installing it, activating it, putting the tracking code in the required field, saving the changes and restarting my NodeBB, neither did the tracking script show up in my front-end code (which Julian himself had explained in another thread here) nor did my Google Analytics show any activity in the real time report.
I then tried putting the whole tracking script in (i) custom header as a script, and (ii) a footer widget, restarting NodeBB multiple times along the way. Both of them showed the script in the front-end code, but my Google Analytics was still silent. As I write this, my NodeBB still runs without an active GA implementation.
I'm not exactly happy with any of the available solutions (regardless of whether they worked or not), since none of them seems to put the tracking code in the place where GA recommends it to be. Julian must be aware that the GA script needs to load before the page's HTML content is loaded in order to capture any DOM changes and stuff, but putting it in a footer widget to dynamically load after the page HTML loads.... defeats the whole purpose.
We chose NodeBB out of other alternatives for our latest project, and have learned the ropes fine so far, though the road was bumpy. I only think that the core package needs a few important functions inbuilt, instead of relying on plugins which may or may not be upgraded in tandem with newer versions of the core package. I have another thread opened here since last week that still needs solving. I sincerely hope that the community helps us get along, and that we made the right decision by choosing NodeBB. Thanks to the NodeBB team for the excellent work they've done, though. No mistaking that.
-
none of them seems to put the tracking code in the place where GA recommends it to be
A recommendation is just a recommendation. If it works, it works.
Julian must be aware that the GA script needs to load before the page's HTML content is loaded in order to capture any DOM changes and stuff
I'm no expert but this doesn't sound right.
-
@karthiks said in Can't get Google Analytics to work:
Julian must be aware that the GA script needs to load before the page's HTML content is loaded in order to capture any DOM changes and stuff
You don't even need a plugin for this, I think... You only need to add the Google Analytics script on <head>, so you should paste your code on ACP Custom Header Content, just like that:
Then click on the slider below "Enable Custom Header" to enable it, click on the floppy disk to save it and the code you pasted will be loaded on the <head> of all your NodeBB pages.
I have it on my site and it tracks the pages perfectly.
-
We never got it to work at all, we gave up. We have CloudFlare in front of us and get data from there. Not as detailed as Google, but WAY more accurate.