CMS Development

CHutt5
Miembro

Track HubSpot Pop Up Forms in Tag Manager

Hi,

 

I'm trying to track hubspot pop up forms in Google Tag Manager but GTm but not having any luck.

 

I have the listener script setup below.

 

<script type="text/javascript">
  window.addEventListener("message", function(event) {
    if(event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmitted') {
      window.dataLayer.push({
        'event': 'hubspot-form-submit',
        'hs-form-guid': event.data.id
      });
    }
  });
</script>

 

I tried setting the trigger to when the pop up is visible (using element visibility trigger) but that also didn't seem to work.

 

Any help is appreciated.

0 Me gusta
2 Respuestas 2
Jaycee_Lewis
Administrador de la comunidad
Administrador de la comunidad

Track HubSpot Pop Up Forms in Tag Manager

Hi, @CHutt5 👋 Thanks for your question. Did you get this resolved? If not, I'll be happy to tag some community members who have GTM expertise.

 

Best,

Jaycee





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




0 Me gusta
CHutt5
Miembro

Track HubSpot Pop Up Forms in Tag Manager

Hi @Jaycee_Lewis,

 

Thanks for your response,

 

Unfortunately not, still looking for a solution.

 

That would be great, thanks.

0 Me gusta