in ,

Leverage Browser Caching by Hosting Analytics Locally with Monster Insights’ WordPress Plugin

Leverage Browser Caching with CAOS and Google Analytics for Wordpress by Monster Insights

It’s a great performance boost for your website to host analytics.js locally. This helps you leverage browser caching, get a perfect 100/100 score on Pagespeed and Pingdom and raise conversion.

An average blog can locally host analytics.js without any fuss. If you’re in ecommerce (e.g. WooCommerce) things get tough, because hosting your Analytics file locally, usually means you can’t use most of Google’s Universal Analytics features.

Today I’m going to show you how you can easily host analytics.js locally, leverage browser caching and still profit from Universal Analytics’ advanced features.

Sidenote:
This post contains affiliate links which can be deemed not trustworthy by some adblockers. All affiliate links in this article resolve to relevant information on MonsterInsights.com, so warnings (if any) can be safely ignored. Enjoy!

Should I Host Analytics Locally?

The idea of locally hosting any file is simple: you copy it to your server, you change the link in your source code to the local copy and you’re done.

Using this technique with analytics.js might work for a day or two, but Google adds new features to Analytics a lot — most of them under the hood.

This means the code is updated a lot and unless you’re manually updating it on a daily basis — meanwhile neglecting your family and pets — your local copy will soon be outdated.

This is why Google advices against it — Because the code gets outdated. I don’t think they care about your relational status.

Leverage Browser Caching — Or why you should forget everything I just said and do it anyway

For you to have the advantage on your customers and make data-driven decisions, you need to be able to observe them. You need Google’s full suite of amazing tools. This is where Universal Analytics comes in.

Once you’ve enabled all of its features (such as enhanced ecommerce), it creates a lot of external requests. And if you’re a Pagespeed Insights user, you’ll die a little bit inside everytime you see this particular notice:

Leverage browser caching for the following cacheable resources:

https://www.google-analytics.com/analytics.js

External requests can be a performance killer. And a website that doesn’t perform, doesn’t convert any sales.

This isn’t rocket science.

Introducing Google Universal Analytics on Steroids

If you’ve been manually updating your local copy of analytics.js to maximize your site’s performance while still being able to use Universal Analytics, from now on you’ll have some extra time left to spend with your wife, kids or dog! They all deserve your attention — and damn you, Google for taking it away from them!

To spare you the headache of manually updating your analytic.js file or settling for a ~75/100 on Pagespeed, Pingdom and GTMetrix, I developed CAOS for Analytics. A nifty plugin that downloads the file automatically and keeps it updated using WordPress’ built-in cron-schedule.

It features tons of options to optimize Google Analytics for your WordPress-website. And the best part is, since version 1.80 it’s fully compatible with Monster Insights’ Google Analytics for WordPress!

Why am I promoting their plugin instead of my own? Well, the reason is simple:

I’m after your money.

No, I’m kidding of course! No more jokes, I promise.

It’s their money I’m after.

I had my fingers crossed! But I’m done now, I swear.

The real reason I decided to fully integrate CAOS for Analytics with Monster Insights’ plugin really is simple:

Monster Insights’ Google Analytics for WordPress features the most complete suite of options [affiliate link] available to WordPress to fully integrate Universal Analytics with your website and configure it to your needs. Even with WooCommerce!

It’s backed by an amazing team of talented WordPress developers. And to be honest, I could never give you the service and speedy updates they deliver.

However, as amazing and good looking as they might be — and they’re quite good looking [affiliate link], they can’t do everything right.

And this is where I come in.

Supercharge Monster Insights’ Google Analytics for WordPress with CAOS for Analytics

Thanks to CAOS for Analytics you can use all of Google Analytics’ amazing features without any loss of performance — and conversion.

To install CAOS for Analytics login to your WordPress Admin-panel and…

Leverage Browser Caching and Host analytics.js locally with CAOS for Analytics for WordPress
How to install CAOS for Analytics for WordPress
  1. Go to Plugins > Add new,
  2. Search for ‘CAOS‘,
  3. Download the plugin by clicking Install,
  4. Press Activate to add the plugin’s options to your admin-screen.

If you prefer installing WordPress plugins manually, you can download CAOS for Analytics as a .zip-archive and extract it to WordPress’ plugins-folder.

To fully integrate CAOS for Analytics with Google Analytics for WordPress by Monster Insights you only have to check one box…

How to enable CAOS for Analytics Monster Insights compatibility mode
Once you enable ‘Compatibility with Monster Insights’… *POOF* all of CAOS for Analytics’ options vanish!
  1. Go to Settings > Optimize Analytics,
  2. Add a check to ‘Enable compatibility with Monster Insights?‘,
  3. Click ‘Save Changes‘.

Once you’ve checked the option you’ll notice most of the other options disappearing off the screen.

Don’t worry, it’s not because they don’t like you anymore. They just want to be somewhere where they can be useful!

After you’ve enabled the compatibility mode Google Analytics will be fully managed by Monster Insights’ plugin. CAOS for Analytics will deliver the locally hosted analytics.js file and keep it updated regularly — like a boss!

Warning! Do not deactivate CAOS for Analytics from the ‘Plugins’-screen, because that will also deactivate the update-script.

I use WooCommerce, can I leverage browser caching and host analytics.js locally?

Absolutely! It’s actually the main reason why I’ve chosen to integrate CAOS for Analytics with Monster Insights’ plugin.

CAOS for Analytics has been around for nearly three years now and all this time WooCommerce-users haven’t been able to host their analytics.js file locally and leverage browser caching. Mostly due to it’s complex tracking devices.

The Pro-version of Google Analytics for WordPress by Monster Insights is built for WooCommerce [affiliate link] and offers tracking solutions for what matters most to you and your enterprise:

  • Universal Tracking,
  • Form Conversion,
  • Affiliate Links,
  • Engagement Tracking,
  • Ecommerce Tracking,
  • Facebook Instant Articles,
  • Enhanced Ecommerce,
  • And much, much more…

Combining CAOS for Analytics with the Pro-version of Google Analytics for WordPress by Monster Insights will give you the best of both worlds. Especially as a WooCommerce-user!

Host analytics.js locally to leverage browser caching and use Universal analytics to get the performance and the advantage you need to raise your sales. Click the image below to find a package that suits your needs! [affiliate link]

Get Google Analytics for WordPress Pro now!
[affiliate link] Google Analytics for WordPress comes in many different flavors. The Pro-package (and up) offer full-fledged WooCommerce Support!

Buy me a beer?

Do you appreciate my work and support? Please consider supporting me by donating, so I can continue to develop and write useful solutions for you.

Choose amount

Personal Message

Thank you! 🙂

Written by Daan van den Bergh

Magento 2 Back-end Developer with a passion for trainlifting, airplane-gliding, hunting trees and creating fake hobbies.

6 Comments

Leave a Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.