2 ms·
I wrote a tiny middleware for Django which sets the DNT variable on the request/response: https://github.com/HearthSim/HSReplay.net/blob/master/hsreplaynet/util
by scrollaway 9y ago
I wrote a tiny middleware for Django which sets the DNT variable on the request/response: https://github.com/HearthSim/HSReplay.net/blob/master/hsreplaynet/utils/middleware.py#L11-L28 https://github.com/HearthSim/HSReplay.net/blob/master/hsrepl...
If dnt is set, Google Analytics isn't served: https://github.com/HearthSim/HSReplay.net/blob/8c1f2eb8cfda64d1c8abcd805b7190a2666b434a/hsreplaynet/templates/footerjs.js#L2 https://github.com/HearthSim/HSReplay.net/blob/8c1f2eb8cfda6...
I completely agree that DNT is flawed but it doesn't cost me much to respect it and the people who set DNT most likely block Google Analytics in one of their extensions anyway. I would rather they see nothing has been blocked.
I also include a link to the EFF's Privacy Badger in our privacy policy, alongside mentioning our DNT policy: https://www.eff.org/privacybadger https://www.eff.org/privacybadger