APIs & Integrations

PCleaud
Contributor

Track custom behavioural event through Hubspot

SOLVE

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

1 Accepted solution
PCleaud
Solution
Contributor

Track custom behavioural event through Hubspot

SOLVE

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.

View solution in original post

6 Replies 6
robertbuijs
Participant | Partner
Participant | Partner

Track custom behavioural event through Hubspot

SOLVE

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

0 Upvotes
PCleaud
Solution
Contributor

Track custom behavioural event through Hubspot

SOLVE

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.

robertbuijs
Participant | Partner
Participant | Partner

Track custom behavioural event through Hubspot

SOLVE

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>

 

0 Upvotes
PCleaud
Contributor

Track custom behavioural event through Hubspot

SOLVE

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 😢

Thanks

0 Upvotes
PCleaud
Contributor

Track custom behavioural event through Hubspot

SOLVE

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

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Track custom behavioural event through Hubspot

SOLVE

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

0 Upvotes