APIs & Integrations

dshorowitz
Member

Backfilling custom events

We’re updating our lead scoring algorithm and would like to include important actions users take inside our app. We were looking at the custom events API and it looks like it will fit the bill.

The only trouble is we’d like to backfill contacts with actions they’ve previously taken, in order to ensure that actions users took in the past aren’t lost. Those actions might be important in our lead score, for example.

Is there anyway to send a timestamp along with an event so that it appears like it happened in the past?

Thanks!

0 Upvotes
8 Replies 8
dshorowitz
Member

Backfilling custom events

Thanks! Would be nice to be able to send a timestamp along with the event :slight_smile:

Is there documentation describing how to use Timeline Events in both lead scoring and workflows? I don’t see it in the UI/UX (unless I’m missing something…)

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Backfilling custom events

The filters would work for properties set for an event, and the specific filters you’d get would be similar to the filters you’d get for contact properties of the same time.

You’ll only see the event type listed if you’ve installed an app that has event types, but once you do you’ll see the event listed at the bottom of the options.


dshorowitz
Member

Backfilling custom events

That’s really great, thanks.

One last question. The Timeline API authentication system seems like it’s based around the concept of developing a custom app that connects to Hubspot (i.e., based on oauth). Our use case isn’t really an app … we just want to be able to fire off API calls based on certain actions the user takes.

Is Timeline API still the recommended approach?

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Backfilling custom events

You would need to create an app in HubSpot for this, since the timeline events get set up as part of the app, and you’d also need to use OAuth to create events after authorizing that app.

Apps don’t automatically get listed in any directory though, so it’s more than possible to create an app that you just use for your own integration.

0 Upvotes
kjproteus
Member

Backfilling custom events

Hi,

I am migrating a customer from Pardot to HubSpot, and they want to import all of the past event activity from Pardot. I assume I can use the Timeline API for that as well, if I just create custom events like PardotClick, PardotOpen, PardotView for historical email and landing page activities?

Sounds like the main issue is that the time stamp will be the current time, not the historical time, correct?

Thanks.

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Backfilling custom events

@kjproteus you can set the timestamp of the event to set the time that the event should appear in the timeline, details for that timestamp are here.

If you’re going to be creating a large number of events, I’d recommend using the batch API:

Create or update a group of timeline events

PUT /integrations/v1/:application‐id/timeline/event/batch - Create or update a group of timeline events

0 Upvotes
csutaria
Participant

Backfilling custom events

I’ve got a similar objective as kjproteus. I think I’m using the timestamp as described in the documentation, and the timestamp is being recognized, but the events are still created with the timestamp of the api call rather than the timestamp I’m providing.

curl -X PUT
https://api.hubapi.com/integrations/v1/REDACTED/timeline/event
-H 'authorization: Bearer REDACTED
-H ‘content-type: application/json’
-d ‘{
“id”:“2”,
“email”:“REDACTED”,
“eventTypeId”:19263,
“activity_id”:“2841260949”,
“activity_type”:“REDACTED”,
“date_text”:“March 14, 2017 9:22:38 AM PDT”,
“details”:“REDACTED”,
“logger”:“REDACTED”,
“timestamp”:1388534400000
}’

The result on the timeline is still this:

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Backfilling custom events

Hi @dshorowitz

We don’t currently have a way to backdate events, so any events that are sent to HubSpot will always count at the time the event was actually triggered.

Backdating would be supported for Timeline Events, which could also be used for lead scoring:

Timeline API Overview

Overview and Walkthrough for the Timeline API

0 Upvotes