When developing for the web, many people use Google Analytics to track, you guessed it, analytical data about users. While the tool is great at what it does, one problem that consistently comes up is the need to keep development analytics from being tracked.
Usually you can use an environment variable on the server-side to only serve the Google Analytics code in production mode. Another option would be to setup a filter in Google Analytics to only track events from a specified domain (your production URL).
The server-side solution is the most elegant in my opinion because filters aren't applied to the Real-TIme analytics, which can be irritating at times. But what if you are simply serving static HTML files, or want to use a separate, development mode Google Analytics account, even in your staging servers that are set to production mode?