wearerequired/required-google-analytics

WordPress plugin to add Google's global site tag (gtag.js) to your site, the modern way.

2.0.1 2019-05-15 07:32 UTC

README

A lightweight WordPress plugin to add Google's global site tag (gtag.js) to your site, the modern way.

The modern way? The script is added with support for preloading, which will provide a small performance boost on modern browsers.
Modern browsers are those that support the async script attribute. This does not include IE 9 and older mobile browsers.

Beside that, the plugin doesn't do more. No fancy report view in your admin, no authentication requirements, no additional scripts, and no ads for random blog posts.

By default the forceSSL and anonymizeIp fields are set to true.

Installation

Install via Composer

$ composer require wearerequired/required-google-analytics

Add you property ID at Settings > Reading > Google Analytics.

Support for analytics.js (Universal Analytics)

Starting with version 2.0 the plugin enqueues gtag.js. If you need support for analytics.js you can continue using the 1.x branch.

$ composer require wearerequired/required-google-analytics:"^1.0"