{"id":20341839,"url":"https://github.com/claytoncollie/tracking-code-for-google-analytics","last_synced_at":"2025-04-11T23:34:19.358Z","repository":{"id":37247407,"uuid":"306894848","full_name":"claytoncollie/tracking-code-for-google-analytics","owner":"claytoncollie","description":"Tracking Code For Google Analytics is a simple, lightweight WordPress plugin for inserting your Google Analytics tracking code. The plugin does one thing and one thing only; prints the standard Google Analytics tracking script to the \u003chead\u003e of your website.","archived":false,"fork":false,"pushed_at":"2024-07-05T10:50:04.000Z","size":676,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T12:11:24.225Z","etag":null,"topics":["analytics","composer","google-analytics","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"https://wordpress.org/plugins/tracking-code-for-google-analytics/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/claytoncollie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-24T13:55:23.000Z","updated_at":"2024-07-05T10:50:08.000Z","dependencies_parsed_at":"2024-11-14T21:30:51.582Z","dependency_job_id":"5d4c6d22-8cfe-41f0-b7cd-a2e8d6788a5b","html_url":"https://github.com/claytoncollie/tracking-code-for-google-analytics","commit_stats":{"total_commits":81,"total_committers":2,"mean_commits":40.5,"dds":0.04938271604938271,"last_synced_commit":"817739c087aa8ca68034cee93bcd0d31e26cd6d4"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claytoncollie%2Ftracking-code-for-google-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claytoncollie%2Ftracking-code-for-google-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claytoncollie%2Ftracking-code-for-google-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claytoncollie%2Ftracking-code-for-google-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/claytoncollie","download_url":"https://codeload.github.com/claytoncollie/tracking-code-for-google-analytics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248495177,"owners_count":21113581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","composer","google-analytics","wordpress","wordpress-plugin"],"created_at":"2024-11-14T21:29:27.203Z","updated_at":"2025-04-11T23:34:19.314Z","avatar_url":"https://github.com/claytoncollie.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tracking Code for Google Analytics\n\n**Contributors:** claytoncollie \\\n**Donate link:** https://commerce.coinbase.com/checkout/2aa628a4-f12e-4231-a6eb-9887ddc6e9aa \\\n**Tags:** google, analytics, tracking code, tracking, universal analytics, tracking snippet \\\n**Requires at least:** 5.0 \\\n**Tested up to:** 6.6.0 \\\n**Requires PHP:** 7.2 \\\n**Stable tag:** 2.0.3 \\\n**License:** GPLv3 or later \\\n**License URI:** https://www.gnu.org/licenses/gpl-2.0.html\n\nSimple, lightweight solution for inserting your Google Analytics Universal tracking code.\n\n## Description\n\nTracking 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 `\u003chead\u003e` of your website. To insert your tracking ID, navigate to Settings \u003e General and then scroll to the bottom of the page.\n\n### Composer\n\n`composer require claytoncollie/tracking-code-for-google-analytics`\n\n### Filters\n\nIf you want to set the tracking ID without using the wp-admin user interface, use the filter below.\n\n`add_filter(\n\t'tracking_code_for_google_analytics_id',\n\t/**\n\t * Set Google Analytics tracking ID.\n\t *\n\t * @param string $tracking_id Tracking ID.\n\t *\n\t * @return string\n\t */\n\tfunction ( string $tracking_id ) : string {\n\t\t$tracking_id \n\n### 'UA-7654321';\n\n\t\treturn $tracking_id;\n\t}\n);`\n\n### Definitions\n\nYou can also define the tracking ID in your wp-config.php file with the following snippet.\n\n`define( 'TRACKING_CODE_FOR_GOOGLE_ANALYTICS_ID', 'UA-7654321' );`\n\n### Contributing\n\nWhile the purpose of this plugin is to be very tightly scoped, [issues and pull requests are welcome on GitHub](https://github.com/claytoncollie/tracking-code-for-google-analytics). I do not guarantee that everything will be merged or support will be given.\n\n### Donate\n\nIf you like this plugin and would like to support my work, [please consider a small donation via Coinbase](https://commerce.coinbase.com/checkout/2aa628a4-f12e-4231-a6eb-9887ddc6e9aa).\n\n## Installation\n\n1. Upload `tracking-code-for-google-analytics` to the `/wp-content/plugins/` directory\n2. Activate the plugin through the 'Plugins' menu in WordPress\n3. Navigate to Settings \u003e General \u003e scroll to the bottom of the page\n4. Insert your tracking ID\n5. Save your changes\n\n## Frequently Asked Questions\n\n### Why did I build this plugin?\n\nThe plugins I have used in the past to solve this problem have too many features for my liking. This plugin is comprised two functions. One for registering a settings field on the Options General page. And another for printing the tracking code to the frontend. I want a lightweight solution for the websites that I build without all of the extra bells and whistles. If you are expecting this plugin to do more or grow in the future, please do not use it.\n\n### Where is the tracking code inserted?\n\nThe tracking code is inserted into the `\u003chead\u003e` section.\n\n### Will this plugin slow down my website?\n\nNo. This plugin is intentionally lightweight. All it does is register a settings field, saves to the database, and then inserts the tracking code. Nothing more.\n\n### I found a bug. How do I report it?\n\n[https://github.com/claytoncollie/tracking-code-for-google-analytics/issues](https://github.com/claytoncollie/tracking-code-for-google-analytics/issues)\n\n### Can I use this plugin with Composer?\n\n[https://packagist.org/packages/claytoncollie/tracking-code-for-google-analytics](https://packagist.org/packages/claytoncollie/tracking-code-for-google-analytics)\n\n## Changelog\n\n### 2.0.3\n\n* Fix readme markdown\n* Bump patch version to deploy\n\n### 2.0.2\n\n* Fix readme markdown\n* Bump patch version to deploy\n\n### 2.0.1\n\n* Patch version bump to deploy properly\n\n### 2.0.0\n\n* Major version. Possible breaking changes. Test locally before updating.\n* Change callback names. Possible breaking change.\n* Bump PHP required version to 7.2\n* Add PHP Namespaces\n* Add PHP parameter type hinting\n* Add PHP return type hinting\n* Add automated static analysis GitHub action\n* Add automated code linting GitHub action\n* Add automated acceptance tests GitHub action\n* Add automated WordPress version checker  GitHub action\n* Add donation link to Coinbase\n* Fix URLs in readme files\n* Fix markdown syntax for changelog in readme.txt\n* Ignore phpstan config from deployed plugin\n* Ignore CONTRIBUTING.md from deployed plugin\n\n### 1.1.0\n\n* Add ability to define tracking in wp-config.php\n* Update documentation\n* Test with WordPress 6.0.0\n\n### 1.0.1\n\n* Update documentation\n* Test with WordPress version 5.6.0\n\n### 1.0.0\n\n* Initial release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaytoncollie%2Ftracking-code-for-google-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclaytoncollie%2Ftracking-code-for-google-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaytoncollie%2Ftracking-code-for-google-analytics/lists"}