Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

101
Visualizações
tracking iframes on multiple URLs in google tag manager

I have a script I'm using to track a form in an iframe on a specific page in Google Tag Manager. My question is how do I modify it so I can track it across multiple pages? Do I need to duplicate the tag and trigger or do I need to modify the script?

<script>
try {
var postObject = JSON.stringify({
event: 'GAEvent',
eventCategory: 'Form',
eventAction: 'Form Submission',
eventLabel: 'Form'
});
parent.postMessage(postObject, 'https://www.example.com/page');
} catch(e) {
window.console && window.console.log(e);
}
</script>

GTM Setup as follows:

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The second argument of window.postMessage() is the URL of the parent. It's made to avoid firing the message for parents that shouldn't get the messages. If you want every parent to get the message regardless of the parent URL, the "*" would be the option to go with.

More information on postMessage is here: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage

Looks like it's not much related to GTM, but more to the mechanics of postMessage.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda