APIs & Integrations

PCleaud
Contributeur

Track custom behavioural event through Hubspot

Résolue

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 Solution acceptée
PCleaud
Solution
Contributeur

Track custom behavioural event through Hubspot

Résolue

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.

Voir la solution dans l'envoi d'origine

6 Réponses
robertbuijs
Participant | Partenaire solutions
Participant | Partenaire solutions

Track custom behavioural event through Hubspot

Résolue

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

0 Votes
PCleaud
Solution
Contributeur

Track custom behavioural event through Hubspot

Résolue

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 | Partenaire solutions
Participant | Partenaire solutions

Track custom behavioural event through Hubspot

Résolue

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 Votes
PCleaud
Contributeur

Track custom behavioural event through Hubspot

Résolue

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 Votes
PCleaud
Contributeur

Track custom behavioural event through Hubspot

Résolue

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

0 Votes
dennisedson
Équipe de développement de HubSpot
Équipe de développement de HubSpot

Track custom behavioural event through Hubspot

Résolue

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

0 Votes