WordPress plugin to add Google's global site tag (gtag.js) to your site, the modern way.
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.
Install via Composer
$ composer require wearerequired/required-google-analytics
Add you property ID at Settings > Reading > Google 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"