Want to add easily configurable google analytics tracking code to your Rails application, but not register you and your development team’s clicks and views? This gem has you covered.
If you’ve ever developed a website with Google Analytics tracking code on it, I’m sure you’ve run into the problem before where you load up your development machine and start registering visits. Not ideal, especially if you start refreshing the page a lot. Or, even worse, frontend CI running after each commit… There’s an awesome Chrome plugin that solves this: Developer Cookie. It allows you to set a custom cookie value, so that if your machine’s cookie matches the value in the analytics script, it doesn’t register a click. Very handy.
In order to make this even more accessible, I’ve created a gem which lets you insert and easily configure not just the developer cookie functionality, but also Google analytics functionality. Configure a few environment variables,
Check out the github page for quickstart and a more detailed description.
Thanks for checking it out, and let me know if there are any useful things you’d like to see added to it.
If you enjoy having free time and the peace of mind that a professional is on your side, then you’d love to have me work on your project.