Adds Google Analytics to the site using Gtag or Google Tag Manager.
Adds Google Analytics to the site supporting:
The module is derived from Shea's analytics module for multisites and supports single site as well as multisites setups.
Note: this version is compatible with SilverStripe 4. For SilverStripe 3, please see the 3.x release line.
Install the module using composer:
composer require innoweb/silverstripe-googleanalytics dev-master
Add <% include Innoweb/GoogleAnalytics/GoogleAnalyticsHead %>
in the head
and <% include Innoweb/GoogleAnalytics/GoogleAnalyticsBody %>
right after the opening body
tag in your
main page template.
Then run dev/build.
All settings can be configured from the CMS.
In your SiteConfig (or the config of your Site when using multisites) you find a tab 'Google Analytics'. Select the analytics type you have setup for your GA account and add the ID. Done.
All GA code only gets inserted in live mode.
The module supports event tracking in the form of external, download, email and phone links.
You can enable event tracking on the SiteConfig (or Site for multisites) in the CMS.
In order to track downloads that use a controller url instead of the direct file
link (i.e. DMS module), please add the following attributes to the links:
class="download" data-extension="$Extension" data-filename="$FilenameWithoutID"
This will trigger the event tracking script to record the clicks.
To exclude links from being tracked add a class do-not-track
to the anchor tag.
This prevent the onclick event from firing.
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem