• 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
#1
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.

Features:
  • ...
Read more about this resource...
 

tajhay

Well-known member
#2
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?
 

RoldanLT

Well-known member
#5
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:
js/trg/local_ga/analytics.js?_v=0ce7af43
Change the cache buster string once updated js file is downloaded.
 

Mouth

Well-known member
#7
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:

Find:
Code:
https://www.google-analytics.com/analytics.js
Replace:
Code:
<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...
Code:
https:https://cdn.site.com/js/trg/local_ga/analytics.js