add fb pixel
This commit is contained in:
parent
9c1dfadbf0
commit
38e74dfbae
1 changed files with 25 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ import { Geist, Geist_Mono } from "next/font/google";
|
|||
import "./globals.css";
|
||||
import Header from "@/components/Header";
|
||||
import Footer from "@/components/Footer";
|
||||
import Script from "next/script";
|
||||
|
||||
const geistSans = Geist({
|
||||
variable: "--font-geist-sans",
|
||||
|
|
@ -32,6 +33,30 @@ export default function RootLayout({
|
|||
<body
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||
>
|
||||
{/* Meta Pixel - Facebook will track automatically */}
|
||||
<Script id="meta-pixel" strategy="afterInteractive">
|
||||
{`
|
||||
!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', '839207998082987');
|
||||
fbq('track', 'PageView');
|
||||
`}
|
||||
</Script>
|
||||
|
||||
<noscript>
|
||||
<img
|
||||
height="1"
|
||||
width="1"
|
||||
style={{ display: "none" }}
|
||||
src="https://www.facebook.com/tr?id=839207998082987&ev=PageView&noscript=1"
|
||||
/>
|
||||
</noscript>
|
||||
<Header />
|
||||
<main>{children}</main>
|
||||
<Footer />
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue