-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need ability to disable analytics in development #8
Comments
Since you're able to define the view you're returning it's reasonably trivial to just create a test view (or use the default 'all traffic' view) on the property, then once it's ready for production you can switch out to the correct view. Or, equally as easy would be to create a filter that would exclude a specific string (e.g. localhost) or IP address from Google Analytics c/f https://support.google.com/analytics/answer/1033162?hl=en. |
Goes GA have a limit for the number of API calls? I'd ideally not hit their server at all and even completely remove the analytics snippet from markup when it's not in use. It seems like filters are created with the intention of removing data you're not necessarily analyzing at this time, but could still be relevant in a different context. Whereas, traffic from a local dev server is never relevant so using a filter to remove it seems like an incorrect use of a filter to me. It's a hack around using imperfect technology. |
See #11 - this module isn't concerned with recording user activity. To disable analytics gathering in development / preview etc. see http://stackoverflow.com/a/1272312/181793 and http://docs.wagtail.io/en/v1.3.1/topics/writing_templates.html?highlight=analytics#varying-output-between-preview-and-live |
So obviously in dev mode we don't want to be making any analytics calls, as you are cluttering the data. It should be turned off, and only send data when in production.
First thought was to just have put the settings in production.py and have analytics disabled without them. But #5 makes a good point as to why this may not be the best approach.
Next I considered having a GA_ENABLED option which you can set to True or False.
But ideally you'll want to be able to test your code in development before sending up to production so you can catch any potential problems. Wondering if Google Analytics has a sandbox environment you can use for testing with their API? Then you could use that in dev more, in which case maybe you'd have a GA_DEV_MODE_ENABLED boolean setting.
Or am I over-complicating this and GA has the ability to filter out data that comes from "localhost" or whatever? Even then, sometimes I use static IP addresses in Vagrant and it could be any random local IP. Not sure.
The text was updated successfully, but these errors were encountered: