Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid serving the GA script to PageSpeed Insights
Google PageSpeed Insights tool often shows a "Leverage Browser Caching" penalization when one is using Google Analytics with the recommended installation method. This sounds very counter-intuitive given that both tools come from Google themselves. This works around that issue by conditionally loading Google Analytics only if the page is not being crawled by Google PageSpeed Insights bot. Google is cheating me, so I'm cheating Google back... ¯\_(ツ)_/¯
- Loading branch information