Solved

Setting event timestamp during import

  • 25 May 2023
  • 6 replies
  • 199 views

Badge

Hello,

 

We have a stack using hightouch, rudderstack, and amplitude to import order data to amplitude.

 

When an event is created in amplitude, it seems to use the timestamp when it is imported, not a designated timestamp.  Am I missing something or can this value not be set?

icon

Best answer by Yuanyuan Zhang 2 June 2023, 14:14

View original

6 replies

Userlevel 5
Badge +8

@Ben Wright welcome! I’ve asked our technical team to dig into this for you.

Userlevel 7
Badge +10

Hey @Ben Wright 

I looked up some docs and here’s what I found.

Are you selecting the event timestamp column before syncing or is it empty?

 

Badge

@Saish Redkar we set a timestamp to the created_at field in rudderstack at the time of sync. We also tried a few other variable names like time and event_time with no change.

Userlevel 5
Badge +5

Hi @Ben Wright

I believe that rudderstack send in data through our HTTP v2 API. With this API, Amplitude uses the key “time” in the JSON event object to determine event time. 

time Optional. The timestamp of the event in milliseconds since epoch. If time isn't sent with the event, then it's set to the request upload time.

 

I checked the raw data for one of your projects, and saw the “time” field was passed with valid values. An example value is: 1685034104000. 

Could you please check with rudderstack what values they are passing to Amplitude for the “time” key? Thanks. 

Badge

 

@Yuanyuan Zhang I’ve passed the time property in the order completed event here.  But you can see that the timeline and event time use the sync timestamp (created_at). 

 

Userlevel 5
Badge +5

Hi @Ben Wright

Passing “time” as an event property will not work. “Time” is a key that should not be included under user property or event property, the general structure should look like this:

"api_key": "xxxxxxxxxx”,
      "raw_data": [
        {
          "app_version": "",
          "device_model": "",
          "os_version": "",
          "device_type": "",
          "language": "",
          "device_carrier": "",
          "device_manufacturer": "",
          "event_type": "xxx",
          "insert_id": "xxx",
          "user_id": "486448",
          "device_brand": "",
          "os_name": "",
          "time": 1684524688000,
          "event_properties": {XXXXXX}

Reply