APIs & Integrations

Não aplicável

Help with GTM trigger firing on the meeting form submit

resolver

Hello! We’re currenting using the Hubspot meeting form to have users signup for demos with our service. We’d like to track ‘conversions’ or essentially form submissions. I’m having trouble getting GTM setup to recognize the form submission.

I’ve tried having a GTM trigger recognize the click_class of the ‘Confirm’ button, used the form class, no luck. Any suggestions? Seems like this is compounded by the fact that the ‘Confirm’ button doesn’t highlight until the form is completely filled out.

Any suggestions or thoughts, I’d appreciate it! Read the GTM docs and everything, feel like i’m close, just can’t get the trigger to fire on the form submission.


Additionally, read some more docs and have the following embedded meeting code in my landing page. Trying to get the push to a GA event working, any help? :slight_smile:

Landing page code:

<!-- Start of Meetings Embed Script -->`
    <div class="meetings-iframe-container" data-src="https://app.hubspot.com/meetings/dan58?embed=true"></div>
    <script type="text/javascript" src="https://static.hsappstatic.net/MeetingsEmbed/ex/MeetingsEmbedCode.js">


    hbspt.forms.create({
          portalId: '2098073',
          formId: 'DEMO',
          onFormSubmit: function($form) {
              ga('send', {
                hitType: 'event',
                eventCategory: 'DEMO',
                eventAction: 'DEMOSUBMIT',
                eventLabel: 'Demo Page'
              });
          } 
    });


</script>
  <!-- End of Meetings Embed Script -->

http://try.fitli.com/demo-signup-full-gtmtest/

1 Solução aceita
Solução
Não aplicável

Help with GTM trigger firing on the meeting form submit

resolver

Thanks for the help! Here’s the set up I used to get this to work:

// Create a Tag to load the Custom Event Listener on our scheduling pages

// Create a Custom Event Trigger when someone books a meeting

// Create a Tag for GA to count the Custom Events

That took a while to figure it, but super satisfying to see it come through. As usual, Simo’s blog (this post in particular) was also super helpful.

Thanks for the help!

Exibir solução no post original

21 Respostas 21
Gaelle-TooPixel
Membro

Help with GTM trigger firing on the meeting form submit

resolver

@ChrisJustin any chance you could help me please ?

0 Avaliação positiva
Não aplicável

Help with GTM trigger firing on the meeting form submit

resolver

Hmmm...I don't see anything immediately apparent. HubSpot has since updated their software to allow for conversion tracking on the meetings tool directly, so maybe you can try that route.

0 Avaliação positiva
antoinepotloc
Participante

Help with GTM trigger firing on the meeting form submit

resolver

@JonWeidberg @ChrisJustin Sorry for the delay guys.

This is a custom listener (a tag in GTM), it allows us to fire another tag

The trigger of the second tag (a GA event) is this:

hope it helps.

0 Avaliação positiva
antoinepotloc
Participante

Help with GTM trigger firing on the meeting form submit

resolver

Crap, the pice of code of the first tag didn’t show up.
here’s a ps

0 Avaliação positiva
Solução
Não aplicável

Help with GTM trigger firing on the meeting form submit

resolver

Thanks for the help! Here’s the set up I used to get this to work:

// Create a Tag to load the Custom Event Listener on our scheduling pages

// Create a Custom Event Trigger when someone books a meeting

// Create a Tag for GA to count the Custom Events

That took a while to figure it, but super satisfying to see it come through. As usual, Simo’s blog (this post in particular) was also super helpful.

Thanks for the help!

Gaelle-TooPixel
Membro

Help with GTM trigger firing on the meeting form submit

resolver

Hello,

Do you think this still works ?
Because I tried on this page : https://www.toopixel.swiss/contact and I can not find why that is not working.
Here is what I have done :


1- Create a Tag to load the Custom Event Listener on this page
2 - Create a Custom Event Trigger when someone books a meeting
3- Create a Tag for GA to count the Custom Events
sorry for this bad picture but as i am a new user i only can upload 1 picture and 1 link ...

Do you see where am I wrong ?

Thanks for your help

0 Avaliação positiva
JonW
Membro

Help with GTM trigger firing on the meeting form submit

resolver

Hi @Antoine_potloc , Would you be able to share the code for the custom listener and how you made it work with the hubspot hosted meeting page?

antoinepotloc
Participante

Help with GTM trigger firing on the meeting form submit

resolver

@JonWeidberg we made it (more my CTO than I to be honest), but in the end it works!
Tag-Trigger-Tag
first a tag : “custom listener” that will create an event (meeting created)

than the trigger will be fired on that event
and than GTM pass the event to GA through normal event flow

Does that make sense? am I clear enough? hope it helps

0 Avaliação positiva
Não aplicável

Help with GTM trigger firing on the meeting form submit

resolver

Would love to see your code for this as well. Struggling with the same issue.

0 Avaliação positiva
JonW
Membro

Help with GTM trigger firing on the meeting form submit

resolver

I love that you got it to work. How did you manage to fire the tag in the
iframe though?

Thanks for updating!

0 Avaliação positiva
derekcavaliero
Top colaborador(a) | Parceiro Diamante
Top colaborador(a) | Parceiro Diamante

Help with GTM trigger firing on the meeting form submit

resolver

You don’t want to trigger your conversion code on the forms “Button Click” as it can and will produce false positives (e.g: user clicks button and form does not submit due to invalid data but your conversion code fires anyways).

Instead, what I suggest is using a Form Submission listener setup as follows:

That will do two things:

  1. The trigger will fire when any hubspot form is submitted - you can change the trigger to only fire for a specific form by using the forms id="" attribute value and modifying your trigger fires on settings.
  2. It will make sure that the trigger only fires if the form passes validation - (NOTE: I have seen a strange issue appearing with GTM form triggers and HubSpot forms that use inline messages instead of redirects for submit actions: "Form submission canceled because the form is not connected" - console warning with embedded forms, for now the only way to avoid that issue I have found is to not use the inline message option for the HubSpot forms)
Derek Cavaliero
Director of Engineering

WebMechanix
www.webmechanix.com
0 Avaliação positiva
JonW
Membro

Help with GTM trigger firing on the meeting form submit

resolver

Thanks Derek. The issue here is that we are trying to add tracking to the meeting tool in Hubspot Sales Pro. It is different from the standard Hubspot forms. Instead of using the form builder, it uses an iFrame that is hosted on Hubspot’s domain, app.hubspot.com/meeting.

We are testing using this tool embedded in a landing page instead of a demo request form since a user could choose to set a time directly instead of the painful back and forth after a form submit. However, we need tracking for GA and conversion pixels.

0 Avaliação positiva
antoinepotloc
Participante

Help with GTM trigger firing on the meeting form submit

resolver

Hey @JonWeidberg, your question is right on target. Have you found a solution?
Does Anybody know how to have meeting form being recognizied as event/lead/anything that can be used as a conversion?

Thanks

0 Avaliação positiva
JonW
Membro

Help with GTM trigger firing on the meeting form submit

resolver

Hi @Antoine_potloc, my only solution was to move on to other challenges with lower hanging fruit. I think this one needs development from Hubspot to move forward.

0 Avaliação positiva
troelsfeodor
Top colaborador(a)

Help with GTM trigger firing on the meeting form submit

resolver

Yes I made it work by editing the hubspot form embed code. Here’s how one of mine looks now:

<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
<![endif]-->
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
  hbspt.forms.create({ 
    css: '',
    portalId: 'XXXXXX',
    formId: '012aaa7e-03df-4c38-83fb-63474af1c182',
    onFormSubmit: function($form) {
		window.dataLayer = window.dataLayer || [];
		
		window.dataLayer.push({
                        'event' : 'step 2',			
                        'eventCategory' : 'lead',
			    'eventAction' : 'trial step 2'
		});
	}
  });
</script>

In GTM I then created a trigger “custom event” with event name “step 2”. This is used as a firing trigger for a tag that does whatever the goal is (GA event, FB pixel conversion tag, etc)

JonW
Membro

Help with GTM trigger firing on the meeting form submit

resolver

Thanks @troelsfeodor, I see how that will work for forms, but how do you use it with the meeting tool which uses the following code instead of forms.create?

<!-- Start of Meetings Embed Script -->
<div class="meetings-iframe-container" data-src="https://app.hubspot.com/meetings/[n`ame]?embed=true"></div>
<script type="text/javascript" src="https://static.hsappstatic.net/MeetingsEmbed/ex/MeetingsEmbedCode.js"></script>
<!-- End of Meetings Embed Script -->
Não aplicável

Help with GTM trigger firing on the meeting form submit

resolver

Nice! Great work, i’ll have to try it out, thanks for the update!

0 Avaliação positiva
alex
Participante

Help with GTM trigger firing on the meeting form submit

resolver

I’m having the same issue. I want to submit a FB Pixel Conversion on a Form Submit.

0 Avaliação positiva
troelsfeodor
Top colaborador(a)

Help with GTM trigger firing on the meeting form submit

resolver

I have the same issue. The onFormSubmit solution doesn’t work with GTM because of the way GTM renames the tracker dynamically which means it will not recognize the ga(‘send’…
So far I’ve come to the conclusion that we instead need to send data to the GTM datalayer via dataLayer.push. I’m still trying to figure out what the correct code for that looks like.
Let me know if you find a solution

0 Avaliação positiva
JonW
Membro

Help with GTM trigger firing on the meeting form submit

resolver

Any luck here? I’m facing the same issue.