From d87be4d434e5749a5fb7744529955526ce3a71c9 Mon Sep 17 00:00:00 2001 From: AI Studio Assistant Date: Sat, 9 May 2026 17:43:23 +0000 Subject: [PATCH] feat: adiciona meta pixel e eventos viewcontent, initiatecheckout e purchase --- index.html | 9 ++++----- src/components/Offer.tsx | 9 +++++++-- src/pages/LandingPage.tsx | 8 ++++++++ src/pages/SuccessPage.tsx | 7 +++++++ 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index d3ba408..8a355da 100644 --- a/index.html +++ b/index.html @@ -93,8 +93,7 @@ - - - --> + diff --git a/src/components/Offer.tsx b/src/components/Offer.tsx index b2193b9..8681196 100644 --- a/src/components/Offer.tsx +++ b/src/components/Offer.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import { useState, type FormEvent } from 'react'; import { motion } from 'framer-motion'; import { Check, ShieldCheck, Gift, ArrowRight, Loader2 } from 'lucide-react'; import { cn } from '../lib/utils'; @@ -15,7 +15,7 @@ export default function Offer() { const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(''); - const handleCheckout = async (e: React.FormEvent) => { + const handleCheckout = async (e: FormEvent) => { e.preventDefault(); if (!email) { setError('Por favor, informe seu e-mail.'); @@ -25,6 +25,11 @@ export default function Offer() { setError('Por favor, informe um e-mail vĂ¡lido.'); return; } + + // Fire InitiateCheckout parameter for Meta Pixel + if (typeof window !== 'undefined' && 'fbq' in window) { + (window as any).fbq('track', 'InitiateCheckout'); + } setIsLoading(true); setError(''); diff --git a/src/pages/LandingPage.tsx b/src/pages/LandingPage.tsx index ba5db60..b2c0953 100644 --- a/src/pages/LandingPage.tsx +++ b/src/pages/LandingPage.tsx @@ -1,3 +1,4 @@ +import { useEffect } from 'react'; import { motion, useScroll, useSpring } from 'framer-motion'; import Navbar from '../components/Navbar'; import Hero from '../components/Hero'; @@ -24,6 +25,13 @@ export default function LandingPage() { // Ativa o repasse automĂ¡tico de UTMs para links de checkout useUTMForwarder(); + useEffect(() => { + // Fire ViewContent parameter for Meta Pixel + if (typeof window !== 'undefined' && 'fbq' in window) { + (window as any).fbq('track', 'ViewContent'); + } + }, []); + return (