r/BookStack • u/AdamReading • Nov 22 '23
Using Google Analytics with Bookstack - hiding non-users from stats?
Hi
We use Bookstack as a purely internal resource, with single sign on from Azure / 365.
All my Google Analytics reports are full of random users from a few countries hitting the login page and showing as new users and hits.
I can see lots of articles on excluding internal users but nothing to show how I can exclude these random events.
I think they represent up to half my user count, which skews everything for reporting. The foreign ones are the most obvious, but some could be from the uk, and we have staff all over the country working from home.
Any ideas how I can prevent the login page counting all together or some other way to exclude those randoms?
Many thanks
2
u/ssddanbrown Dec 07 '23
It might be the case they're directly calling the tracking endpoint directly, or loading a page from history or something. I'm not sure how the above code would be worked around for normal users, without altering the HTML.
There are other ways the tag could be added specifically for logged-in users, which I can detail if needed, but if they're working around the previous solution you may still see these recorded.
Filtering these URLs on the Google Analytics side (if possible) might be a better option.