diff --git a/src/components/analytics/FacebookPixels.tsx b/src/components/analytics/FacebookPixels.tsx new file mode 100644 index 0000000..7dc4766 --- /dev/null +++ b/src/components/analytics/FacebookPixels.tsx @@ -0,0 +1,47 @@ +"use client"; + +import Script from "next/script"; + +interface FacebookPixelsProps { + pixels?: string[]; +} + +/** + * Facebook Pixel Integration Component + * + * Loads Facebook pixel tracking scripts dynamically based on pixel IDs + * received from the backend. Each pixel is initialized with PageView tracking. + * + * @param pixels - Array of Facebook pixel IDs to load + */ +export function FacebookPixels({ pixels }: FacebookPixelsProps) { + if (!pixels || pixels.length === 0) { + return null; + } + + return ( + <> + {pixels.map((pixelId) => ( +