About event triggering via HTTP API


#1

I have a problem while using the HTTP API to trigger events:

The problem I am facing is this:

Whenever I try to hit the API to tiger an event, I can only do it by using the _n=event_id parameter, but not with the _n=event_name

ie: failing event trigger url:
http://track.hubspot.com/v1/event?_a=449964&_n=mobile_app_submitted&email=fpv.vitale.@gmail.com doesn’t working event trigger url:
http://track.hubspot.com/v1/event?_a=449964&_n=000001180398&email=fpv.vitale.@gmail.com

I am not sure what I can be doing wrong, can anyone give me a hint?

Thanks a lot!


#2

Hi @fpvvitale

Are you not seeing that event in HubSpot at all? Or not seeing completions? Completions don’t update in realtime, but you should see any new events created this way within a minute or so, and you should be able to see more realtime data for the event by l=viewing the activity log, which you can find in the event details, in the left sidebar.


#3

Thanks for your help.
I am not taking into account the completions.
I have been checking the Activity Log, left sidebar option, and all I can see is log entries for the urls where I put the event_id, and none of the event_name. This is the test I just did:

When clicking on:
http://track.hubspot.com/v1/event?_a=449964&_n=mobile_app_submitted&email=fpv.vitale.@gmail.com
Waited 5 minutes, and the log is the one on the left of the attached image.

When clicking on:
http://track.hubspot.com/v1/event?_a=449964&_n=000001180398&email=fpv.vitale.@gmail.com
Waited 1 minute, and the log is the one on the right of the attached image.

As you can see, the completions is still 8 all the time as you correctly said. However the log is only showing the triggered event using the event_id, and not the event_name. Do you see any wrongly formed param in the url or any that I could give a try?
Thank you one more time.


#4

If you’re creating an event in the UI, you’d need to use the numerical ID to trigger that event, and it can’t be triggered using the name of the event.

Events have 2 values that that get used to count completions, the numerical ID, and an internal name. For events getting creating in the HubSpot app, the only value that gets set is the numerical ID, so triggering an event with the name won’t count towards completions, since the intent was that the numerical ID would be used to trigger that specific event.

Creating an event through the API sets the internal name (as well as the numerical ID). the intent with this was to allow events to be dynamically created (without creating the event manually in the app first), and that if the same event was triggered again, we’d count it towards the previously dynamically created event.

Sorry for the confusion on this, I’ll get the docs updated to more accurately reflect how this works.


#5

Okay thanks for your help. Please go ahead and update the api docs for this topic, since it’s saying (at least that’s what I understand) that event triggering using name as param in the url is supported. Thanks again.


#6

Agreed, @dadams can someone update the API? Spent a good amount of time trying to figure this out.

Also I’d like to explain the case, it is handy to use the name, because it is environment independent. I don’t need to set variables within code mapping id’s to names for each environment, I could just use the name throughout all environments.