Local Google Analytics (with CDN support)

Local Google Analytics (with CDN support) 1.0.0

No permission to download


Well-known member
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...
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?
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.
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...
Top Bottom