An easy and basic Google Analytics extension for TYPO3.

Installs: 6 914

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 7

Forks: 0

Open Issues: 1


1.0.1 2021-09-15 11:51 UTC


Actions Downloads


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:
  googleAnalyticsTrackingId: UA-11111111-1


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