WordPress plugin intelligence profile

Tracking Code for Google Analytics

Simple, lightweight solution for inserting your Google Analytics Universal tracking code.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 6.6
Current version2.0.3
WordPress coverageTested up to WordPress 6.6
Minimum stackWP 5.0 · PHP 7.2
Directory statusactive
Last directory update5 Jul 20242y ago
Active installations100Adoption metric — not a quality score
WordPress.org ratingNo WordPress.org ratings yet
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Tracking Code for Google Analytics version 2.0.3 as active, updated 2y ago and tested up to WordPress 6.6.

Overview

About this plugin

Tracking Code For Google Analytics is a simple, lightweight WordPress plugin for inserting your Google Analytics Universal Analytics tracking code. The plugin does one thing and one thing only; prints the standard Google Analytics tacking script to the <head> of your website. To insert your tracking ID, navigate to Settings > General and then scroll to the bottom of the page.

Composer

composer require claytoncollie/tracking-code-for-google-analytics

Filters

If you want to set the tracking ID without using the wp-admin user interface, use the filter below.

add_filter( 'tracking_code_for_google_analytics_id', /** * Set Google Analytics tracking ID. * * @param string $tracking_id Tracking ID. * * @return string */ function ( string $tracking_id ): string { $tracking_id = 'UA-7654321'; return $tracking_id; } );

Definitions

php file with the following snippet.

define( 'TRACKING_CODE_FOR_GOOGLE_ANALYTICS_ID', 'UA-7654321' );

Contributing

While the purpose of this plugin is to be very tightly scoped, issues and pull requests are welcome on GitHub. I do not guarantee that everything will be merged or support will be given.

Donate

If you like this plugin and would like to support my work, please consider a small donation via Coinbase.

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • tracking code
  • universal analytics
  • google
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 6.6

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 6.6.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to6.6
Minimum requirementsWordPress 5.0 · PHP 7.2
Update activity5 Jul 20242y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.