{"id":20406640,"url":"https://github.com/xwp/ga4-extensions","last_synced_at":"2026-04-20T07:03:15.323Z","repository":{"id":262277464,"uuid":"886682980","full_name":"xwp/ga4-extensions","owner":"xwp","description":"Extends GA4 by injecting custom data","archived":false,"fork":false,"pushed_at":"2024-12-06T14:03:55.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-30T13:03:35.486Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/xwp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2024-11-11T12:19:41.000Z","updated_at":"2024-12-06T14:03:58.000Z","dependencies_parsed_at":"2025-01-15T11:52:03.613Z","dependency_job_id":null,"html_url":"https://github.com/xwp/ga4-extensions","commit_stats":null,"previous_names":["xwp/ga4-extensions"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xwp/ga4-extensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwp%2Fga4-extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwp%2Fga4-extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwp%2Fga4-extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwp%2Fga4-extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xwp","download_url":"https://codeload.github.com/xwp/ga4-extensions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwp%2Fga4-extensions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32036803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-15T05:18:28.385Z","updated_at":"2026-04-20T07:03:15.288Z","avatar_url":"https://github.com/xwp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Analytics 4 Extensions\n\n\u003e Extends Google Analytics 4 by including custom data for enhanced GA4 analytics.\n\n## Features\n\n- **User Properties:** Sets `user_properties` with `is_subscriber` (0 or 1) on all pages.\n- **Post Data:** On single post pages, outputs `post_author`, `post_category`, and `post_tags`.\n\n## Usage\n\nExample code output:\n\n```html\n\u003cscript id=\"ga4-ext-gtagjs-js-before\"\u003e\n    window.dataLayer = window.dataLayer || [];\n    function gtag() {\n        dataLayer.push(arguments);\n    }\n    gtag(\"set\", \"linker\", {\n        \"domains\": [\"example.com\"]\n    });\n    gtag(\"js\", new Date());\n    gtag(\"config\", \"G-1234\", {\n        \"post_author\": \"dev\",\n        \"post_category\": \"news\",\n        \"post_tags\": \"featured\"\n    });\n    gtag(\"set\", \"user_properties\", {\n        is_subscriber: 0\n    });\n\u003c/script\u003e\n\u003cscript src=\"https://www.googletagmanager.com/gtag/js?id=G-1234\" id=\"ga4-ext-gtagjs-js\" defer data-wp-strategy=\"defer\"\u003e\u003c/script\u003e\n```\n\n## Installation\n\n### Using Composer\n\nTo install the plugin via Composer, follow these steps:\n\n1. **Add the Repository:**\n   - Open your project's `composer.json` file.\n   - Add the following under the `repositories` section:\n\n     ```json\n     \"repositories\": [\n         {\n             \"type\": \"vcs\",\n             \"url\": \"https://github.com/xwp/ga4-extensions\"\n         }\n     ]\n     ```\n\n2. **Require the Plugin:**\n   - Run the following command in your terminal:\n\n     ```bash\n     composer require xwp/ga4-extensions\n     ```\n\n3. **Activate the Plugin:**\n   - Once installed, activate the plugin through the 'Plugins' menu in WordPress.\n\n### Manual Installation\n\n1. **Download the Plugin:**\n   - Download the `ga4-extensions` plugin folder.\n\n2. **Upload the Plugin:**\n   - Add the `ga4-extensions` folder to the `/wp-content/plugins/` directory of your WordPress installation.\n\n3. **Activate the Plugin:**\n   - Activate the plugin through the 'Plugins' menu in WordPress.\n\n## Configuration\n\nTo enable GA4 tracking, follow these steps:\n\n- In your WordPress dashboard, go to **Settings** \u003e **General**.\n- Input your GA4 ID (e.g., `G-1234567`) into the **Google Analytics 4 ID** field.\n- Click **Save Changes**.\n\n## Google Analytics 4 - Configure Custom Dimensions\n\nTo use the custom data in Google Analytics 4, you need to create custom events and parameters in the GA4 dashboard. Here's how you can set it up:\n\n1. Navigate to [Google Analytics](https://analytics.google.com/analytics/web/) and sign in with your account credentials with an Administrative role.\n2. Select the property you want to track.\n3. Access the Admin Panel - Click the Admin gear icon located in the bottom-left corner of the interface.\n4. In the *Data display* section, click on `Custom definitions`.\n5. For each custom dimension (post_author, post_category, post_tags), follow these steps:\n  a. Click Create Custom Dimension.\n  b. Dimension Name: Post XXX (e.g., Post Author)\n  c. Scope: Event\n  d. Event Parameter: post_author\n  e. Click Save.\n\n## Requirements\n\n- **WordPress:** Version 6.5 or higher.\n- **PHP:** Version 8.1 or higher.\n\n## License\n\nThis plugin is licensed under the GPLv3 or later.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxwp%2Fga4-extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxwp%2Fga4-extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxwp%2Fga4-extensions/lists"}