Sent an event to Google Analytics when embedded meeting form is submitted
SOLVE
Hi, everyone!
I am looking for a way to send events to GA, when embedded meeting form is submitted on my landing page. It will allow me to send events to FB & Google ADs accounts to train performance campaigns. Unfortunately, I couldn't find any doc on how to implement this. This article is on a similar topic, but it applies only to "Marketing - Forms" tool, which doesn't have the required time booking option. https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options?_ga=2.208428626.1790481021.1...
Could you help me to find a way to capture form submission from the meeting iframe on an external site?
// Note, you need to have the meeting scheduler embedded on a page where this event listener is also active. Take a look at the domain of the iframe the scheduler is embedded through and make sure it matches this conditional check. if ( event.origin != 'https://meetings-eu1.hubspot.com' ) return false;
// You'll need our GTM base code installed so that this dataLayer push triggers events to various platforms. if ( event.data.meetingBookSucceeded ) { window.dataLayer.push({ event: 'hubspot_meeting_booked' }); console.log('hubspot_meeting_booked'); }
Sent an event to Google Analytics when embedded meeting form is submitted
SOLVE
Hey @KReimer, if you want to trigger other events to Google Analytics here's the code for all three (embed form submissions, landing page submissions and embed meetings):
// Note, you need to have the meeting scheduler embedded on a page where this event listener is also active. Take a look at the domain of the iframe the scheduler is embedded through and make sure it matches this conditional check. if ( event.origin != 'https://meetings-eu1.hubspot.com' ) return false;
// You'll need our GTM base code installed so that this dataLayer push triggers events to various platforms. if ( event.data.meetingBookSucceeded ) { window.dataLayer.push({ event: 'hubspot_meeting_booked' }); console.log('hubspot_meeting_booked'); }