{"id":26870847,"url":"https://github.com/msigley/wp-simple-google-analytics","last_synced_at":"2026-05-19T03:18:16.062Z","repository":{"id":73785635,"uuid":"220532319","full_name":"msigley/WP-Simple-Google-Analytics","owner":"msigley","description":"Simple Google Analytics implementation for Wordpress that avoids using cookies and external javascript.","archived":false,"fork":false,"pushed_at":"2024-09-30T16:25:36.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-05T07:59:04.815Z","etag":null,"topics":["cookies","google-analytics","localstorage","php","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msigley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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,"zenodo":null},"funding":{"ko_fi":"wpsimple"}},"created_at":"2019-11-08T19:14:21.000Z","updated_at":"2024-09-30T16:20:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"bfeec43b-9439-4814-a1ce-2fb1ecdc4442","html_url":"https://github.com/msigley/WP-Simple-Google-Analytics","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/msigley/WP-Simple-Google-Analytics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msigley%2FWP-Simple-Google-Analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msigley%2FWP-Simple-Google-Analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msigley%2FWP-Simple-Google-Analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msigley%2FWP-Simple-Google-Analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msigley","download_url":"https://codeload.github.com/msigley/WP-Simple-Google-Analytics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msigley%2FWP-Simple-Google-Analytics/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265436867,"owners_count":23765049,"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":["cookies","google-analytics","localstorage","php","wordpress","wordpress-plugin"],"created_at":"2025-03-31T07:17:28.959Z","updated_at":"2026-05-19T03:18:16.034Z","avatar_url":"https://github.com/msigley.png","language":"PHP","funding_links":["https://ko-fi.com/wpsimple","https://ko-fi.com/A0A01FORH"],"categories":[],"sub_categories":[],"readme":"[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/A0A01FORH)\n# WP Simple Google Analytics\nA Google Analytics 4 implementation for Wordpress that focuses on protecting visitor privacy.\n\n* All advertising, audience, and user personalization features are disabled.\n* GA client ids are generated locally on server and stored on the visitor's web browser using a first party cookie.\n* Sanitizes query vars in URLs sent to Google to Wordpress's publicly allowed query vars plus: `gclid, dclid, _gl`\n* Parses the following utm query vars and sets the appropriate GA campaign values: `utm_id, utm_source, utm_medium, utm_campaign, utm_source_platform, utm_term, utm_content`\n* Does not track traffic in the following situations to improve data accuracy in GA:\n  * Current user can edit posts.\n  * In admin area or responding to an ajax request.\n  * Invalid or internal IP addresses.\n  * Bot traffic detected or missing User Agent.\n    * Googlebot traffic is allowed for site verification, pagespeed insights, etc.\n\nBecause of the proactive privacy features and the disabling of advertising features, GA tracking does not need to be put behind a consent banner. This further improves the data accuracy in GA.\n\n## Configuration\nConfiguration is done by defining PHP constants in your /wp-config.php file. Below is an example configuration:\n```php\n/**\n * Google Analytics Tracking\n */\ndefine('GOOGLE_ANALYTICS_TAG_ID', 'G-XXXXXXXXXX');\ndefine('GOOGLE_ANALYTICS_TRACK_INTERNAL_IPS', false);\ndefine('GOOGLE_ANALYTICS_TRACK_BOTS', false);\ndefine('GOOGLE_ANALYTICS_DO_NOT_TRACK_IPS',\n\tserialize(\n\t\tarray(\n\t\t\t'0.0.0.0'\n\t\t)\n\t)\n);\n```\n### Configuration Options\n#### GOOGLE_ANALYTICS_TAG_ID\nThe Google Analytics Tracking ID you wish to use for this website.\n\nhttps://support.google.com/analytics/answer/9539598\n\n#### GOOGLE_ANALYTICS_TRACK_INTERNAL_IPS\nWhether or not internal IP addresses should be tracked. Defaults to false to avoid inflating the tracking with loopback requests. You may wish to turn this on to test your site while developing locally or if you have a proxy or CDN implemented on your website.\n\n#### GOOGLE_ANALYTICS_TRACK_BOTS\nWhether or not bot traffic should be tracked. Defaults to false to avoid inflating the tracking.\n\n#### GOOGLE_ANALYTICS_DO_NOT_TRACK_IPS\nArray of IP addresses that will never be tracked. Useful to eliminate businesses from inflating the tracking with traffic coming from themseleves. IPv4 addresses, IPv6 addresses, and IPv4 CIDR blocks are supported.\n\n## Opt out link\nA link for your users to opt out of Google Analytics tracking is required by Google Analytics' terms of service. \n\nhttps://marketingplatform.google.com/about/analytics/terms/us/\n\nThe link can be added by using the ```[google_analytics_opt_out_link]``` shortcode on your privacy policy page.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsigley%2Fwp-simple-google-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsigley%2Fwp-simple-google-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsigley%2Fwp-simple-google-analytics/lists"}