{"id":5787,"date":"2024-02-21T18:43:19","date_gmt":"2024-02-21T15:43:19","guid":{"rendered":"https:\/\/trackingchef.com\/?p=5787"},"modified":"2024-02-21T18:44:09","modified_gmt":"2024-02-21T15:44:09","slug":"hubspot-meetings-tracking-with-google-tag-manager","status":"publish","type":"post","link":"https:\/\/trackingchef.com\/google-tag-manager\/hubspot-meetings-tracking-with-google-tag-manager\/","title":{"rendered":"Hubspot Meetings tracking with (and w\/o) Google Tag Manager"},"content":{"rendered":"\n

Hubspot’s Meeting Scheduler is a great solution for offering leads to quickly set a demo with your team without back and forth emails on availability and time zones.<\/p>\n\n\n\n

While it didn’t kill Calendly, mostly since it lacks plenty of its great features, it’s still a neat tool that many B2B clients use. Since it plays a crucial role in the lead capture process, it is very important to capture the conversions driven by this widget.<\/p>\n\n\n\n

In this post I’ll walkthrough the various options for tracking these conversions in Google Tag Manager.<\/p>\n\n\n

\n
\"\"
Hubspot Meeting Scheduler (Source: Hubspot<\/a>)<\/figcaption><\/figure><\/div>\n\n\n

Hubspot Meetings tracking with Google Tag Manager<\/h2>\n\n\n\n

To track engagement with the widget we need to add a Custom HTML tag with an event listener.<\/p>\n\n\n\n

Create a new tag of the type Custom HTML and paste in the script below.<\/p>\n\n\n\n

<script>\nwindow.addEventListener( 'message', function(event) {\n  if ( event.data.meetingBookSucceeded ) {\n          window.dataLayer.push({\n        \t'event': 'hubspot_meeting_booked'\n\t      });\n  }\n});\n<\/script><\/code><\/pre>\n\n\n\n

Trigger this tag to fire on All Pages.<\/p>\n\n\n\n

<\/p>\n\n\n

\n
\"\"
The Custom HTML tag and trigger<\/figcaption><\/figure><\/div>\n\n\n

Next, create a new trigger of the type Custom Event.<\/p>\n\n\n\n

The event’s name will be hubspot_meeting_booked<\/code>.<\/p>\n\n\n

\n
\"\"
Meeting booked trigger<\/figcaption><\/figure><\/div>\n\n\n

Congratulations, you’re all set!<\/p>\n\n\n\n

You can now connect this trigger to any tag in your container.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Hubspot Meetings tracking without Google Tag Manager<\/h2>\n\n\n\n

For those of you who don\u2019t use GTM (shame on you!), there\u2019s also a solution available. It utilizes the same Javascript logic and triggers the event directly to Google Analytics via the gtag <\/em>method.<\/p>\n\n\n\n

Add this snippet to any page that has a meetings widget you want to track.<\/p>\n\n\n\n

<script>\nwindow.addEventListener( 'message', function(event) {\n  if ( event.data.meetingBookSucceeded ) {\ngtag('event', 'hubspot_meeting_booked<\/span>');\n  }\n});\n<\/script><\/code><\/pre>\n\n\n\n

Bonus #1 – Enhanced Conversions<\/h2>\n\n\n\n

If you want to send Advanced Matching<\/a> signals with the event, you can alter the script slightly to report the user’s email from the widget.<\/p>\n\n\n\n

<script>\nwindow.addEventListener( 'message', function(event) {\n  if ( event.data.meetingBookSucceeded ) {\n          window.dataLayer.push({\n        \t'event': 'hubspot_meeting_booked',\n        \t'email': event.data.meetingsPayload.bookingResponse.postResponse.contact.email\n\t      });\n  }\n});\n<\/script><\/code><\/pre>\n\n\n\n

Bonus #2 – Meeting Widget Views<\/h2>\n\n\n\n

If you’re interested in measuring the widget’s conversion rate, you can trigger an event whenever it was viewed.<\/p>\n\n\n\n

Simply create an Element Visibility trigger that observes a CSS Selector of the value .meetings-iframe-container<\/code>.<\/p>\n\n\n

\n
\"\"<\/figure><\/div>\n\n\n

You can then add this trigger to a GA4 Event.<\/p>\n\n\n

\n
\"\"<\/figure><\/div>","protected":false},"excerpt":{"rendered":"

Hubspot’s Meeting Scheduler is a great solution for offering leads to quickly set a demo with your team without back and forth emails on availability and time zones. While it didn’t kill Calendly, mostly since it lacks plenty of its great features, it’s still a neat tool that many B2B clients use. Since it plays […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39,42],"tags":[],"_links":{"self":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/5787"}],"collection":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/comments?post=5787"}],"version-history":[{"count":2,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/5787\/revisions"}],"predecessor-version":[{"id":5795,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/5787\/revisions\/5795"}],"wp:attachment":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/media?parent=5787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/categories?post=5787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/tags?post=5787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}