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.

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:

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.

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…

Once you enable ‘Compatibility with Monster Insights’… *POOF* all of CAOS for Analytics’ options vanish!

Go to Settings > Optimize Analytics,

Add a check to ‘Enable compatibility with Monster Insights?‘,

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?

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]

WooCommerce has their own (free) google analytics plugin available. Can I use this with CAOS? Will the monster checkbox have the same effect (I am guessing no)? Can I point the WC plugin to the local JS file?

I have gotten this question many times, and after reading yours, I looked into it again. At this moment I haven’t found a foolproof way to implement a compatibility mode with WooCommerce’s own Google analytics integration plugin into CAOS for Analytics. Sorry 🙁

Choose Amount:

Personal Message:

Wake me up in case of:

This website uses cookies to display contextual advertising for users in the European Economic Area (EEA). No personal information is collected in this process. For users outside the EEA we use cookies to display personal advertising. If you want to know more or withdraw your consent to all or some of the cookies, please refer to the privacy policy. By closing this banner or continuing to browse otherwise, you agree to the use of cookies.DismissPrivacy Policy