{"id":21832485,"url":"https://github.com/joecohens/next-fbq","last_synced_at":"2025-04-14T07:21:24.305Z","repository":{"id":65424449,"uuid":"138256230","full_name":"joecohens/next-fbq","owner":"joecohens","description":"Next.js HOC to integrate the Facebook Pixel on every page change","archived":false,"fork":false,"pushed_at":"2018-08-04T08:50:59.000Z","size":25,"stargazers_count":21,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T21:02:13.848Z","etag":null,"topics":["facebookpixel","fb","high-order-component","hoc","nextjs","react"],"latest_commit_sha":null,"homepage":null,"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/joecohens.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}},"created_at":"2018-06-22T04:56:02.000Z","updated_at":"2022-08-12T12:47:41.000Z","dependencies_parsed_at":"2023-01-23T01:45:25.619Z","dependency_job_id":null,"html_url":"https://github.com/joecohens/next-fbq","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joecohens%2Fnext-fbq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joecohens%2Fnext-fbq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joecohens%2Fnext-fbq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joecohens%2Fnext-fbq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joecohens","download_url":"https://codeload.github.com/joecohens/next-fbq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837173,"owners_count":21169379,"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":["facebookpixel","fb","high-order-component","hoc","nextjs","react"],"created_at":"2024-11-27T19:20:16.507Z","updated_at":"2025-04-14T07:21:24.268Z","avatar_url":"https://github.com/joecohens.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# next-fbq\n\nNext.js High Order Component to integrate Facebook Pixel on every page change.\n\n## Usage\n\nInstall it\n\n```bash\nyarn add next-fbq\n```\n\nImport it inside your `pages/_app.js`;\n\n```js\nimport Router from \"next/router\";\nimport withFBQ from \"next-fbq\";\n```\n\nWrap your [custom App container](https://nextjs.org/docs#custom-%3Capp%3E) with it\n\n```js\n// pass your Facebook Pixel code as first argument\nexport default withFBQ(\"139xxxxxxxxx3\", Router)(MyApp);\n```\n\nThat's it, now when the user access a page it will log a pageview to Facebook Pixel, each page change after that will also trigger a pageview on FB Pixel. The second argument is used to tell next-fbq you are wrapping your `_app` instead of each page individually (defaults to `true`), in that case it will run on `componentDidUpdate` too.\n\n\u003e **Note**: This module detects if it's running in localhost and do nothing there to avoid polluting your analytics with local data.\n\n\n# Credits\n\nThis is a complete copy of [@sergiodxa](https://github.com/sergiodxa) Google Analytics implementation [next-ga](https://github.com/sergiodxa/next-ga/blob/master/src/analytics.js) adapted to the Facebok Pixel\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoecohens%2Fnext-fbq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoecohens%2Fnext-fbq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoecohens%2Fnext-fbq/lists"}