diff --git a/src/pages/_app.js b/src/pages/_app.js index 3638580..d466a61 100644 --- a/src/pages/_app.js +++ b/src/pages/_app.js @@ -223,16 +223,15 @@ export default function App({ Component, pageProps }) { strategy="afterInteractive" dangerouslySetInnerHTML={{ __html: ` - !function(f,b,e,v,n,t,s) - {if(f.fbq)return;n=f.fbq=function(){n.callMethod? - n.callMethod.apply(n,arguments):n.queue.push(arguments)}; - if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; - n.queue=[];t=b.createElement(e);t.async=!0; - t.src=v;s=b.getElementsByTagName(e)[0]; - s.parentNode.insertBefore(t,s)}(window, document,'script', - 'https://connect.facebook.net/en_US/fbevents.js'); - fbq('init', '${NEXT_PUBLIC_PIXEL_ID}'); - fbq('track', 'PageView'); + !function(f,b,e,v,n,t,s) + {if(f.fbq)return;n=f.fbq=function(){n.callMethod? + n.callMethod.apply(n,arguments):n.queue.push(arguments)}; + if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; + n.queue=[];t=b.createElement(e);t.async=!0; + t.src=v;s=b.getElementsByTagName(e)[0]; + s.parentNode.insertBefore(t,s)}(window, document,'script', + 'https://connect.facebook.net/en_US/fbevents.js'); + fbq('init', ${NEXT_PUBLIC_PIXEL_ID}); `, }} /> diff --git a/src/pages/_document.js b/src/pages/_document.js index 77612ee..d8140ad 100644 --- a/src/pages/_document.js +++ b/src/pages/_document.js @@ -1,4 +1,5 @@ -import { Head, Html, Main, NextScript } from 'next/document' +import { Head, Html, Main, NextScript } from 'next/document'; +import { NEXT_PUBLIC_PIXEL_ID } from "@/firebaseConfig"; export default function Document() { @@ -96,7 +97,7 @@ export default function Document() { height="1" width="1" style={{ display: 'none' }} - src={`https://www.facebook.com/tr?id=${process.env.NEXT_PUBLIC_PIXEL_ID}&ev=PageView&noscript=1`} + src={`https://www.facebook.com/tr?id=${NEXT_PUBLIC_PIXEL_ID}&ev=PageView&noscript=1`} /> diff --git a/src/pages/index.js b/src/pages/index.js index 2dd72c8..f3c8fd6 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -77,14 +77,6 @@ export default function Home() {