Local Google Analytics (with CDN support)

xF1 Add-on Local Google Analytics (with CDN support) 1.0.0

No permission to download
📀 Resource submitted by: Admin • 💬 Messages: 15975 • 🏆 Points: 113 • 👍 Likes: 56377 • 📀 Resources: 5998
Compatible XF Versions
  1. 1.5
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:
  • Enable/disable local Google Analytics
  • If you defined a CDN in your config.php, the analytics.js will be served via your CDN automatically
  • Cron task to automatically fetch analytics.js from Google and update your local file
Installation:
Unzip the archive and upload the contents of the "upload" folder to your forum root directory. Then go to "List Add-ons" -> "+Install Add-on", choose the unzipped .xml-file and import it.

Configuration:
Go to "Options" -> "Statistics & Metrics", enable the add-on and set the absolute path to your analytics.js (e.g./var/www/YOURDOMAIN/httpdocs/js/trg/local_ga/analytics.js):
xenforo_com_community_attachments_screenshot_options_jpg_135771__.jpg

The cron task runs once a month (at the 15th during the night). You may change it to your needs.

Result:

Before
xenforo_com_community_attachments_screenshot_console_before_jpg_135772__.jpg


After
xenforo_com_community_attachments_screenshot_console_after_jpg_135773__.jpg


Just perform a speed test and you will see that the “Leverage Browser Caching” warning vanished.

Translations:
Coming soon.
Author
Admin
Size
14.6 KB
Extension
zip
Downloads
4
Views
1,691
First release
Last update

More resources from Admin

Similar resources

Local Time - PixelExit AnimeHaxor
isplay a user's local time in the postbit.
[TH] Member's Local Time Admin
Show a member's local time on their profile, member card, and posts
Links XenForo with Google Calendar, syncing members' birthdays and more.

740Threads
2,311Messages
67,984Members
ceohongphatLatest member
Back