APIs & Integrations

jhiissa
Member

Defect in dynamic event re-creation

Hi,

I found a defect related to the JavaScript API and dynamic event creation. I want to create the HubSpot events dynamically, instead of creating them in advance on HubSpot side, and use product names from web shop as the event id. Here’s an example of the JavaScript that I’m using:
_hsq.push([“trackEvent”, {
id: “Product X”
}]);

Initially, everything works fine. The HubSpot event is created dynamically and all calls are being captured. However, if the event is deleted then it’s not re-created. Even if you re-create the event manually with the correct name it doesn’t help.

This is actually quite a serious problem for me because I cannot change the event ids and I’ve already deleted certain events that are needed. So hopefully this defect could be fixed. I’ve already contacted support but they said that they are not able to help with JavaScript API related issues.

Regards,
Jukka

0 Upvotes
10 Replies 10
olansiona
Member

Defect in dynamic event re-creation


@jhiissa wrote:

Hi,

I found a defect related to the JavaScript API and dynamic event creation. I want to create the HubSpot events dynamically, instead of creating them in advance on HubSpot side, and use product names from web shop as the event id. Here’s an example of the JavaScript that I’m using:
_hsq.push([“trackEvent”, {
id: “Product X”
}]);

Initially, everything works fine. The HubSpot event is created dynamically and all calls are being captured. However, if the event is deleted then it’s not re-created. Even if you re-create the event manually with the correct name it doesn’t help.

This is actually quite a serious problem for me because I cannot change the event ids and I’ve already deleted certain events that are needed. So hopefully this defect could be fixed. I’ve already contacted support but they said that they are not able to help with olansi JavaScript API related issues.

Regards,
Jukka


Hi jukka,

Thank for asking i was facing the same issue but after doing a lot of research i was unable to found the best solution. Then i have saw your thread and really get amazed to see the response. And i finally i have sorted my query too with your help. Many Thanks again. 

 

Regards,

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Defect in dynamic event re-creation

Hi @gostudyaustralia,

You should be able to direct message me here by clicking on my avatar image and then clicking the 'Message' button in the modal that pops up.

0 Upvotes
gostudyaustrali
Member

Defect in dynamic event re-creation

Done, thanks..........

Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Defect in dynamic event re-creation

Hi @gostudyaustralia,

Can you direct message me your Hub ID and a list of the events you need recreated (if possible)?

0 Upvotes
gostudyaustrali
Member

Defect in dynamic event re-creation

Hi Derek, I've got the list. How can I privately message you? :slight_smile:

0 Upvotes
gostudyaustrali
Member

Defect in dynamic event re-creation

Hi,
I'm experiencing the same issue with my account.

It seems that hubspot API does not re-create events that are manually deleted.

Can you please help me?

thanks

0 Upvotes
dilloncompton
HubSpot Product Team
HubSpot Product Team

Defect in dynamic event re-creation

We’ve undeleted the events that seemed to have meaningful names. There were a number with IDs like “null”, “testxx”, etc which we left deleted. If you ID any specific additional items which you want restored, please let us know.

Thanks!
//Dillon

0 Upvotes
jhiissa
Member

Defect in dynamic event re-creation

Great, thanks for your help.

Regards,
Jukka

0 Upvotes
dilloncompton
HubSpot Product Team
HubSpot Product Team

Defect in dynamic event re-creation

Hi Jukka,

This is a known behavior on our side; the feature was initially designed for the customer base who is configuring and managing these events solely via the UI. We definitely recognize the current behavior is less ideal for the API user, and I’ve passed that feedback on to the analytics team.

If you can share your HubID and the IDs of the events you deleted but still need (feel free to either respond here or DM me), I can have the team manually restore them to get you unblocked.

Thanks!

//Dillon

0 Upvotes
jhiissa
Member

Defect in dynamic event re-creation

Thanks! I just sent you the Hub ID via private message.

The HubSpot JS API is slightly limited since you cannot add additional variables to the trackEvent call (like product name or id). Thus, I find the dynamic event creation a really handy feature since then you only need to have one event call defined on the calling application side and the needed variables can be placed to the id field. Managing a large amount of events and event calls manually would be quite tedious.

Regards,
Jukka