• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Local Google Analytics (with CDN support)

Local Google Analytics (with CDN support) 1.0.0

No permission to download
TRGCommunity submitted a new resource:

Local Google Analytics (with CDN support) - Fix that damn “Leverage Browser Caching” warning

IMPORTANT: This resource is unsupported!

Based on this blog entry, I decided to create an add-on, as I finally wanted to fix the “Leverage Browser Caching” warning you get when you perform a speed test on your website.

What does it do?
It replaces the URL in the google_analytics template with the URL of your local analytics.js.

  • ...
Read more about this resource...


Well-known member
Does the addon do anything besides removing the warning and puting the google analytics template in your local path? i.e. Does it make the site faster?


Well-known member
Feature request:
I think much better to grab the analytics.js everyday not once a month.
Then append versioning/cache buster on the js file like:
Change the cache buster string once updated js file is downloaded.


Well-known member
Heads-up for others and @TRGCommunity that this no longer works and stops analytics loading as of XF 1.5.13, due to changes in the google_analytics template to force https.
The fix is to enable developer mode and adjust Local Google Analytics modification's of the google_analytics template. Change required:

<xen:if is="{$xenOptions.TRG_localga_enable}">{$javaScriptSource}/trg/local_ga/analytics.js<xen:else />https://www.google-analytics.com/analytics.js</xen:if>
Without this fix, the HTML output for calling analytics locally is broken. Eg...