tomdyson / wagalytics

A Google Analytics dashboard in your Wagtail admin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need ability to disable analytics on staging server

alexgleason opened this issue · comments

Kind of like #8, but I also just realized you don't want it on the stage either, which is a completely separate problem to solve and one that comes with its own set of issues. Quite a complex problem, really. Obviously you don't want analytics on a stage as it's a waste of API calls and clutters the data with information the client shouldn't be concerned with.

But how do you detect that we're on a staging server when it uses production.py? Some sort of blacklist? Or a separate library that's installed on the stage that reports that it's a stage? Not sure how to do this and minimizing the burden of it for everyone involved.

Wondering if @ftarnell has any ideas?

This module isn't concerned with storing user activity; it assumes that you're doing that already. I should probably make that clearer in the documentation.

There are several established techniques for not recording activity in development, staging, preview etc. See http://docs.wagtail.io/en/v1.3.1/topics/writing_templates.html?highlight=analytics#varying-output-between-preview-and-live and http://stackoverflow.com/a/1272312/181793 for some pointers.

Hmm. I thought you might close all my issues for this reason. :) Didn't realize this was the case until afterwards.

That said, these are some GA problems that need solving and could use a Wagtail package. I see your linked articles, which are helpful. Though ideally with Wagtail we can get to a point where we can pip install as much as possible to have to do less work. Seems like a good opportunity to use this package to also ship some integration functionality. If not it would just be in a separate package.

I've updated the README to make it more obvious for future generations :)