Track custom behavioural event through Hubspot

Hello,

I am trying to track a custom behavioral event through Google Tag Manager on an external website.

Setup :

  • All pages of the website have the Hubspot tracking code
  • I have created a manually tracked event in Hubspot
  • I have created a custom HTML tag in Google tag manager with the following code in it:
<script type="text/javascript">
_hsq.push(['trackCustomBehavioralEvent',{ 
 Name: "InternalNameOfOurCustomEvent",
 properties: { hs_asset_type: "landing-page",
 	hs_app_name: "NameOfOurApp"}
}
]);
</script>
  • I have created a trigger in Google Tag Manager to trigger the previous tag on certain pages of the external website

I am not seeing any events being logged in even when I test it myself (I have authorized cookie tracking).

Any help would be very much appreciated
Pierre

@Kevin-C , any chance you could help out here?

Hi, I am still trying to find a solution to this problem so any help would be very much appreciated. Pierre

Hi, me again. I would be extremely greateful if a Hubspot dev had the time to help me with this. I am seeing the right URL being called in the console and all the query parameters are passed correctly. But the event is still not registered in Hubspot :cry:

Thanks

We’re experiencing exactly the same issue. Have not found the solution yet.

I found the solution through the Hubspot slack developer community : the key “Name” in my code was supposed to be lowercase “name”. It solved the issue for me.

Awesome, thanks. Turns out our mistake was using “eventName” instead of “name”. Data is coming through now.

So the final result, if I’m correct, should be:

<script type="text/javascript">
_hsq.push(['trackCustomBehavioralEvent',{ 
 name: "lowercaseeventname",
 properties: { hs_asset_type: "landing-page",
 	hs_app_name: "NameOfOurApp"}
}
]);
</script>