Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

239
Vistas
How to add javascript code snippet in react-helmet?

I am using react-helmet to push elements in the head. The code snippet that needs to be used is of GTM and e-commerce tracking. But, I'm not able to find a way to insert script in head anyway. The documentation shows for loading from external source. The code snippet has dynamic values that are being used.

The documentation is from tthis url : react-helmet

<Helmet script={[
                {src: "http://include.com/pathtojs.js", type: "text/javascript"},
                {type: "application/ld+json", innerHTML: `{ "@context": "http://schema.org" }`}
            ]}
/>
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The documentation is correct. This works

<Helmet 
  script={[{ 
    type: 'text/javascript', 
    innerHTML: 'console.log("It works!")' 
  }]} />

Check your version of Helmet - the innerHTML attribute was introduced in Helmet 3.0.0

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda