Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

An easy and basic Google Analytics extension for TYPO3.

License

Notifications You must be signed in to change notification settings

visuellverstehen/t3googleanalytics

Repository files navigation

Actions Downloads

t3googleanalytics

An easy and basic Google Analytics extension for TYPO3.

How to use

  1. Install TYPO3 extension via composer, TER or download and install manually.
  2. Configure the extension
  3. Call googleAnalyticsDisable() or googleAnalyticsEnable() via JavaScript to disable or enable Google Analytics. By default it is enabled. The user can disable tracking with a simple button which can look like this: <a onclick="return googleAnalyticsDisable();">Disbale GA Opt Tracking</a>

Configure the extension

There are several options to add your tracking id. The following list will show you all options in the prioritized order.

  1. Add the tracking ID within the sys_template row via the backend module

screenshot of the new field inside the template backend module

  1. When you add your template through the runThroughTemplatesPostProcessing hook add the tracking ID like so:
// $row is your template record array
$row['constants'] .= 'google_analytics_tracking_id = UA-11111111-1';
  1. Add the tracking ID directly to the settings section inside your site configuration file:
settings:
  googleAnalyticsTrackingId: UA-11111111-1

Tips

  • To allow onclick events within CKEditor add extraAllowedContent: '*(*)[onclick]' to your CKEditor configuration file. Then you can add a link with onclick="return googleAnalyticsDisable();"

About

An easy and basic Google Analytics extension for TYPO3.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages