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

148
Vistas
Implement Window Data Layer Push in React App

I'm trying to implement window.data.layer.push in my react application so I can use it with Google Tag Manager but I am unsure where it would go. this is my base app.js file

// import the GTM Module so you can access it
import TagManager from "react-gtm-module";

const tagManagerArgs = {
    gtmId: "GTM-P8J3MKF"
  };
  
TagManager.initialize(tagManagerArgs)

const { persistor, store } = configureStore();

const MGMW = () => (
  <Provider store={store}>
    <PersistGate loading={null} persistor={persistor}>
  {/*<LoginScene className='main-background' />*/}
      <LayoutBase />
      <GlobalModals />
    </PersistGate>
  </Provider>
);

const rootElement = document.getElementById('app-root');
if (rootElement) render(<MGMW />, rootElement);

export default MGMW;
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You must use useEffect hook.

useEffect(() => {
    /*script to be executed here*/
}, [])

This is the componentDidMount version of React Hooks. More on the subject here: https://reactjs.org/docs/hooks-effect.html

about 4 years ago · Juan Pablo Isaza Denunciar

0

There is an NPM package that can help you with this: https://www.npmjs.com/package/react-gtm-module

about 4 years ago · Juan Pablo Isaza 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