APIs & Integrations

darshanDV
Membro

Tracking code not working with function calls

 

Hello, 
We have an AngularJs 1.5 SPA website with a non-hubspot form. We have added the HubSpot tracking code, have added code to manually track pageviews, identify a visitor and events. Whenever a form submission happens, we can see in the network tab a GET request to track.hubspot.com (with 200 OK)  captured from the form submission.
Below code is used to push the event.

 

var _hsq = window._hsq = window._hsq || [];
_hsq.push(["identify", {
    email: params.contactEmail, 
    firstname: params.contactName,
    phone: params.contactNumber,
}]);
_hsq.push(["trackCustomBehavioralEvent", { 
    name: "Lead creation",
    properties: {
        email: params.contactEmail
    }
}]);

 

The tracking code have been added to the website correctly :

 

<script>
var _hsq = window._hsq = window._hsq || [];
_hsq.push(['setPath', '/home-page-path']);
</script>
<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/the-domain-id.js"></script>
<script>
var _hsq = window._hsq = window._hsq || [];
_hsq.push(['setPath', '/some-path']);
_hsq.push(['trackPageView']);
</script>

 

I have added the above function calls for creating contacts and events as per https://developers.hubspot.com/docs/api/events/tracking-code#identify-a-visitor.
But for some reason i'm not able to see any of the page view or contacts created.
 
Is creation of contacts with tracking code available on Free License? Or is there anything else that needs to be done?
Any help would be immensely appreciated.
0 Avaliação positiva
1 Resposta 1
dennisedson
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

Tracking code not working with function calls

@tominal , any chance you could lend a hand here?

0 Avaliação positiva