APIs & Integrations

Nbergamini
Member

Callback fired when the hubspot script with tracking code is created

Hello everyone,

 

I work on a web app that uses the Hubspot script tracking code => 'https://js.hs-scripts.com/${trackingCode}.js' in a way to use fonctionnalities of Hubspot.

 

I load another script at the beginning of my app (meetings embed script) to allow my users to take an appointment. In that case, my problem is that sometimes, the first Hubspot script is not loaded correctly in the page before the second script start to load, and infortunately it fires a 404 error on the meetings embed script.

 

I tried already to find a way to handle this, like using a callback to add on the script, but I don't find that on the documentation nor developpers forums.

 

Does anyon! Thanks by advance !

 

Nathan B.

2 Replies 2
Robav
Participant

Callback fired when the hubspot script with tracking code is created

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Callback fired when the hubspot script with tracking code is created

Hey @Nbergamini,

 

Just to clarify, currently you're embeding the HubSpot meeting widget on your web app and you'd like it to load first before the second script, is that right? If so, would you mind elaborating further the reason behind loading the meeting widget script before the second script?

 

Additionally, I dug into how to run a javascript before the other one and I believe this discussion on stack overflow may be helpful: https://stackoverflow.com/questions/10947424/how-to-run-a-javascript-script-before-the-other-ones.

0 Upvotes