The code returns the following error:
[v0] Error submitting lead: fetch failed
at Module.POST (/app/api/submit-lead/route)
at async handleSubmit (/components/lead-form)
Revise the code to address the error.
I was previewing: /
I can see the issue - the code is trying to fetch a Google Apps Script URL that doesn't exist yet (it's still using a placeholder URL). The fetch is failing because the GOOGLE_SCRIPT_URL environment variable is not configured with a real deployment URL. Since the user needs this to work now, I'll modify the approach to make the form functional without requiring complex Google Apps Script setup.
Corrigi o erro tornando a integração com Google Sheets opcional - o formulário agora funciona imediatamente, salvando os dados nos logs do servidor e redirecionando para o WhatsApp, mesmo que a URL do Google Apps Script ainda não esteja configurada. Quando você seguir as instruções em scripts/google-apps-script-setup.txt e adicionar a variável de ambiente GOOGLE_SCRIPT_URL, os dados começarão a ser enviados automaticamente para sua planilha.
colar no head : <!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-53BZPJV2');</script> <!-- End Google Tag Manager -->body: <!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-53BZPJV2"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
Adicionei o Google Tag Manager (GTM-53BZPJV2) ao layout da aplicação. O script principal foi inserido no head usando dangerouslySetInnerHTML para executar o código GTM, e o iframe noscript foi adicionado logo após a abertura do body para garantir tracking mesmo quando JavaScript está desabilitado.
precisava somente corrigir o fivecon que não esta aparecendo corretamente.