{"id":20579576,"url":"https://github.com/danilo-89/next-app-directory-gtag","last_synced_at":"2026-06-06T10:31:23.473Z","repository":{"id":211617643,"uuid":"729522967","full_name":"danilo-89/next-app-directory-gtag","owner":"danilo-89","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-19T14:24:46.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-16T22:26:07.624Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://next-app-directory-gtag.vercel.app","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/danilo-89.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":"2023-12-09T13:55:30.000Z","updated_at":"2023-12-11T08:41:35.000Z","dependencies_parsed_at":"2023-12-19T16:18:14.952Z","dependency_job_id":"de5310f9-993d-4511-9702-78602572d0a6","html_url":"https://github.com/danilo-89/next-app-directory-gtag","commit_stats":null,"previous_names":["danilo-89/next-app-directory-gtag"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danilo-89%2Fnext-app-directory-gtag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danilo-89%2Fnext-app-directory-gtag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danilo-89%2Fnext-app-directory-gtag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danilo-89%2Fnext-app-directory-gtag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danilo-89","download_url":"https://codeload.github.com/danilo-89/next-app-directory-gtag/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242206004,"owners_count":20089252,"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-11-16T06:17:26.818Z","updated_at":"2026-06-06T10:31:23.383Z","avatar_url":"https://github.com/danilo-89.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NextJS (with App Router) gtag example\n\nThis project serves as a basic showcase for implementing Next.js (App Router) with the incorporation of Google Tag Manager to handle Google Tag and Cookie Consent functionalities.\n\nApproach used in this example ensures that gtm script is not injected and no data is sent to google tag manager until user consent for cookies has been granted\n\n## Environment Variable\n\nSet the GTAG_ID environment variable in your project with your Google Tag Manager ID.\n\n## Basic usage example\n\n**layout.tsx**\n\n```javascript\nexport default function RootLayout({\n\tchildren,\n}: {\n\tchildren: React.ReactNode,\n}) {\n\treturn (\n\t\t\u003chtml lang='en'\u003e\n\t\t\t\u003cGTagProvider tagId={process.env.GTAG_ID}\u003e\n\t\t\t\t\u003cbody\u003e{children}\u003c/body\u003e\n\t\t\t\u003c/GTagProvider\u003e\n\t\t\u003c/html\u003e\n\t);\n}\n```\n\n**template.tsx**\n\n```javascript\nimport { type ReactNode } from 'react';\n\nimport ConsentDialog from '@/components/ConsentDialog';\n\nfunction template({ children }: { children: ReactNode }) {\n\treturn (\n\t\t\u003cmain\u003e\n\t\t\t{children}\n\t\t\t\u003cConsentDialog /\u003e\n\t\t\u003c/main\u003e\n\t);\n}\n\nexport default template;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanilo-89%2Fnext-app-directory-gtag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanilo-89%2Fnext-app-directory-gtag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanilo-89%2Fnext-app-directory-gtag/lists"}