{"id":21272761,"url":"https://github.com/jooy2/ga-mp-tester","last_synced_at":"2025-07-11T06:32:42.334Z","repository":{"id":237454402,"uuid":"638717398","full_name":"jooy2/ga-mp-tester","owner":"jooy2","description":"Request data manually with this script file and the Google Analytics 4 Measurement Protocol. You can easily send data with pre-prepared settings that allow you to include repetitive dummy data. Built for Google Analytics 4.","archived":false,"fork":false,"pushed_at":"2023-08-01T10:56:55.000Z","size":257,"stargazers_count":6,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-02T02:20:40.880Z","etag":null,"topics":["analytics","ga4","google-analytics","google-analytics-4","google-analytics-api","gtag","measurement-protocol","tracking"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jooy2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":"jooy2","custom":["https://jooy2.com/donate"]}},"created_at":"2023-05-10T00:41:09.000Z","updated_at":"2024-05-02T02:21:32.555Z","dependencies_parsed_at":"2024-05-02T02:20:46.997Z","dependency_job_id":null,"html_url":"https://github.com/jooy2/ga-mp-tester","commit_stats":null,"previous_names":["jooy2/ga-mp-tester"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jooy2%2Fga-mp-tester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jooy2%2Fga-mp-tester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jooy2%2Fga-mp-tester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jooy2%2Fga-mp-tester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jooy2","download_url":"https://codeload.github.com/jooy2/ga-mp-tester/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225700964,"owners_count":17510448,"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","ga4","google-analytics","google-analytics-4","google-analytics-api","gtag","measurement-protocol","tracking"],"created_at":"2024-11-21T09:09:09.410Z","updated_at":"2024-11-21T09:09:10.110Z","avatar_url":"https://github.com/jooy2.png","language":"JavaScript","funding_links":["https://github.com/sponsors/jooy2","https://jooy2.com/donate"],"categories":[],"sub_categories":[],"readme":"# Google Analytics Measurement Protocol Tester\n\nRequest data manually with this script file and the Google Analytics 4 Measurement Protocol. You can easily send data with pre-prepared settings that allow you to include repetitive dummy data.\n\nBuilt for Google Analytics 4.\n\n## How to use\n\nThis project requires a **[NodeJS](https://nodejs.org)** (16.x or higher) installation to configure.\n\nFor a detailed description of the Measurement Protocol API, see the links below.\n\nhttps://developers.google.com/analytics/devguides/collection/protocol/ga4\n\nFirst, clone this project. Then create an `.env` file in the root of your project. This file should be properly organized to match the template below.\n\n```dotenv\nMEASUREMENT_ID=G-**********\nAPI_SECRET=**********************\nSEND_AMOUNT=1\nNEXT_REQUEST_WAITING_TIME_MILLISEC=1000\nSINGLE_USER=true\nLOGGING=true\nDEBUG_MODE=false\n```\n\nFor an example file, see `.env.example`. This file is not involved in the actual behavior.\n\n- `MEASUREMENT_ID`: GA4 tracking code (with `G-`)\n- `API_SECRET`: Measurement protocol API password\n- `SEND_AMOUNT`: The number of times to send data repeatedly. If no value, defaults to `1`.\n- `NEXT_REQUEST_WAITING_TIME_MILLISEC`: Request latency when the following data needs to be sent (Milliseconds)\n- `SINGLE_USER`: Set this value to `true` if you don't want the UID/CID to be different per request\n- `LOGGING`: Set this to `true` to see the request body and other progress in the console\n- `DEBUG_MODE`: Set this value to `true` to be sent as GA4 debug monitoring data. If `true`, it will not be added as actual report data and will only be displayed in `debugView`. (https://support.google.com/analytics/answer/7201382)\n\nThe GA 4 event parameter values used when sending requests can be written in the `event_defs.json` file in the project root:\n\n```json5\n[\n\t{\n\t\tname: 'page_view', // Event name\n\t\tparams: {\n\t\t\t// Event parameters\n\t\t\tpage_location: '/', // Page path\n\t\t\tpage_title: 'Page Name' // Page title\n\t\t\t// \"your_custom_dimension_1\": \"hello\",\n\t\t\t// \"your_custom_dimension_2\": \"world\",\n\t\t}\n\t}\n]\n```\n\nWhen you manually send a data request, the UID/CID and associated data is sent along with the actual report so that it can be displayed in the real-time dashboard. This process is handled automatically by the script, but the UID/CID might be different from what you actually require.\n\nOnce you're done, send the request via the `npm` command below.\n\n```shell\n$ npm run start\n```\n\n## License\n\nCopyright © 2023 [Jooy2](https://jooy2.com) \u003c[jooy2.contact@gmail.com](mailto:jooy2.contact@gmail.com)\u003e Released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjooy2%2Fga-mp-tester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjooy2%2Fga-mp-tester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjooy2%2Fga-mp-tester/lists"}