{"id":22903927,"url":"https://github.com/tracktor/react-google-tag-manager","last_synced_at":"2026-02-02T14:31:46.189Z","repository":{"id":143163089,"uuid":"614920059","full_name":"Tracktor/react-google-tag-manager","owner":"Tracktor","description":"React library for use easily the Google Tag Manager","archived":false,"fork":false,"pushed_at":"2024-06-27T09:53:38.000Z","size":331,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-18T18:04:31.242Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Tracktor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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}},"created_at":"2023-03-16T15:25:55.000Z","updated_at":"2024-06-27T09:05:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"83a69c7d-d6d0-4672-a4b3-a99526ad0ae8","html_url":"https://github.com/Tracktor/react-google-tag-manager","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Tracktor/react-google-tag-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tracktor%2Freact-google-tag-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tracktor%2Freact-google-tag-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tracktor%2Freact-google-tag-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tracktor%2Freact-google-tag-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tracktor","download_url":"https://codeload.github.com/Tracktor/react-google-tag-manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tracktor%2Freact-google-tag-manager/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260726054,"owners_count":23053068,"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":[],"created_at":"2024-12-14T02:39:01.068Z","updated_at":"2026-02-02T14:31:46.184Z","avatar_url":"https://github.com/Tracktor.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Google Tag Manager\n\n[![npm version](https://badge.fury.io/js/%40tracktor%2Freact-google-tag-manager.svg)](https://badge.fury.io/js/%40tracktor%2Freact-google-tag-manager)\n\n**Very light React library for use easily the Google Tag Manager**\n\n\n- [Installation](#Installation)\n- [Usage](#Usage)\n- [Props and options](#Props-and-Options)\n- [Hooks](#kook)\n\n## Installation\n\n```console\nyarn add @tracktor/react-google-tag-manager\n```\n\nor\n\n\n```console\nnpm install @tracktor/react-google-tag-manager\n```\n\nor \n\n```console\nbun add @tracktor/react-google-tag-manager\n```\n\n\n## Usage\n\n```typescript jsx\nimport { GoogleTagManagerProvider, useGoogleTagManager } from \"@tracktor/react-google-tag-manager\";\n\nconst App = () =\u003e (\n  \u003cGoogleTagManagerProvider id=\"YOUR_GOOGLE_TAG_ID\"\u003e\n    \u003cYourComponent /\u003e\n  \u003c/GoogleTagManagerProvider\u003e\n);\n\nconst YourComponent = () =\u003e {\n  const { sendEvent } = useGoogleTagManager();\n\n  return (\n    \u003cmain\u003e\n      \u003ch1\u003eYour Component\u003c/h1\u003e\n      \u003cbutton type=\"button\" onClick={() =\u003e sendEvent({ event: \"eventName\", value: \"someValue\" })}\u003e\n        Click me\n      \u003c/button\u003e\n    \u003c/main\u003e\n  );\n};\n\nexport default App;\n```\n\n\n## Props and options\n\nYour can provide some props and options to the provider.\n\n```typescript jsx\nimport { GoogleTagManagerProvider } from \"@tracktor/react-google-tag-manager\";\n\nconst App = () =\u003e (\n  \u003cGoogleTagManagerProvider id=\"YOUR_GOOGLE_TAG_ID\" options={{ dataLayerName: \"...\" }}\u003e\n    ...\n  \u003c/GoogleTagManagerProvider\u003e\n);\n\nexport default App;\n```\n| Props   | Type       | Default   | Description                                                                                                                   |\n|---------|------------|-----------|-------------------------------------------------------------------------------------------------------------------------------|\n| id      | GTM-XXXXXX | undefined | Define the Google Tag Manager ID id. You can create an account to get an ID here : https://tagmanager.google.com/?hl=fr#/home |\n| options | object     | undefined | Provider options                                                                                                              |\n\n\n| Option        | Type   | Default                                 | Description             |\n|---------------|--------|-----------------------------------------|-------------------------|\n| scriptUrl     | string | https://www.googletagmanager.com/gtm.js | Set script url to load  |\n| dataLayerName | string | dataLayer                               | Set the data layer name |\n\n\n## Hooks\n`useGoogleTagManager`\n\n| Export    | type     | Description    |\n|-----------|----------|----------------|\n| sendEvent | function | Send GTM event |\n| id        | string   | The GTM id     |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftracktor%2Freact-google-tag-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftracktor%2Freact-google-tag-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftracktor%2Freact-google-tag-manager/lists"}