{"id":22513356,"url":"https://github.com/xd2sketch/next-google-tag-manager","last_synced_at":"2025-08-03T16:30:49.084Z","repository":{"id":180397206,"uuid":"662095311","full_name":"XD2Sketch/next-google-tag-manager","owner":"XD2Sketch","description":"Easily implement Google Tag Manager in your Next 13+ project","archived":false,"fork":false,"pushed_at":"2023-12-01T01:52:52.000Z","size":3431,"stargazers_count":47,"open_issues_count":5,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-12-06T04:48:32.463Z","etag":null,"topics":["google-tag-manager","next","nextjs","nextjs13","react"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@magicul/next-google-tag-manager","language":"TypeScript","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/XD2Sketch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-07-04T10:46:22.000Z","updated_at":"2024-11-21T01:56:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"9ac9ecba-d893-4787-97c6-b58f094fd36c","html_url":"https://github.com/XD2Sketch/next-google-tag-manager","commit_stats":null,"previous_names":["xd2sketch/next-google-tag-manager"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XD2Sketch%2Fnext-google-tag-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XD2Sketch%2Fnext-google-tag-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XD2Sketch%2Fnext-google-tag-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XD2Sketch%2Fnext-google-tag-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XD2Sketch","download_url":"https://codeload.github.com/XD2Sketch/next-google-tag-manager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228552374,"owners_count":17935803,"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":["google-tag-manager","next","nextjs","nextjs13","react"],"created_at":"2024-12-07T03:11:39.697Z","updated_at":"2024-12-07T03:11:40.337Z","avatar_url":"https://github.com/XD2Sketch.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @magicul/next-google-tag-manager\n\n![npm bundle size](https://img.shields.io/bundlephobia/min/@magicul/next-google-tag-manager)\n![npm](https://img.shields.io/npm/dt/next-google-tag-manager)\n![GitHub issues](https://img.shields.io/github/issues/XD2Sketch/next-google-tag-manager)\n![npm](https://img.shields.io/npm/v/@magicul/next-google-tag-manager)\n![GitHub Repo stars](https://img.shields.io/github/stars/XD2Sketch/next-google-tag-manager?style=social)\n\nA lightweight Next 13 library to easily implement Google Tag Manager\nin your projects. This package forwards all of the page changes to\nGoogle Tag Manager so you can easily track your users.\n\n## Installation\n\nInstall this package with `npm`\n\n```bash\nnpm i @magicul/next-google-tag-manager\n```\n\nOr with `yarn`\n\n```bash\nyarn add @magicul/next-google-tag-manager\n```\n\n## Usage\n\n### Using the GoogleTagManager component\n\nTo initialize Google Tag Manager, add `\u003cGoogleTagManager /\u003e`\nto `app/layout.tsx` like this:\n\n```tsx\nimport GoogleTagManager from '@magicul/next-google-tag-manager';\n\nconst RootLayout = ({ children }) =\u003e (\n  \u003chtml lang=\"en\"\u003e\n    \u003cbody\u003e\n      \u003cGoogleTagManager id=\"GTM-XXXXX\" /\u003e\n      {children}\n    \u003c/body\u003e\n  \u003c/html\u003e\n);\n```\n\nNote: This package\nutilizes [next/script](https://nextjs.org/docs/basic-features/script),\nwhich means you **can't** place it inside a `next/head`.\n\n### Configuring\n\nTo customize the way you load Google Tag Manager, you can pass the\nfollowing props to the component:\n\n| Prop name   | Type   | Default value            | Description                                                                                                                                                                                                                                                       |\n|-------------|--------|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| id          | string | -                        | The ID of your Google Tag Manager container                                                                                                                                                                                                                       |\n| server      | string | www.googletagmanager.com | The tagging server that is used, you can configure your own server here or use the default Google Tag Manager server by default. This is used for server side tagging. Please only put the domain, subdomain and top level domain here to make it work correctly. |\n| auth        | string | -                        | Authentication string for the container configuration.                                                                                                                                                                                                            |\n| environment | string | -                        | The environment that is used, see [Environments - Tag Manager Help](https://support.google.com/tagmanager/answer/6311518?hl=en) for more information                                                                                                              |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxd2sketch%2Fnext-google-tag-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxd2sketch%2Fnext-google-tag-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxd2sketch%2Fnext-google-tag-manager/lists"}