You would use the hook 'action:meta.override404' and do a helpers.redirect(res, '/'); You might have to copy some of the code from https://github.com/NodeBB/NodeBB/blob/master/src/controllers/404.js#L24-L44. So you don't redirect requests to javascript files to the homepage for example.
Google analytics plugin
-
Hey. I got a problem with analytics plugin. When I navigate through forums, every page is counted as "unique" visitor in google analytics and so it counts as a 100% bounce rate. And now, I just came to my forum and saw 60 online users, I thought it can't be true because I didn't atvertise it anywhere, it is kinda private so far. So I went to google analytics and saw that 60 active, but every of them were from my computer and 100% bounce rate. Is it only me or it is happening to others?
EDIT: I noticed it shows not my computer, it shows SERVER as active visitor even though I am not browsing a forum. It seems like server browses all available topics automatically and google analytics counts it as a visit
-
-
@julian i thought I read somewhere about client side hook
action:page.load
, if that's true, can the ga plugin just use that on the browser to trigger page views, and no more server-side ga?Also, if I may suggest, using the newer GA, for a better async tracking
//google-analytics.com/analytics.js vs //google-analytics.com/ga.js
-
@bentael Oh probably, the plugin itself is due for a rewrite, and uses a hook that really shouldn't be used, since a client-side alternative would be much better.
trackEvent
for page loads, possibly... Perhaps I can take a look at this plugin tomorrow, time permitting.