Skip to main content
Solved

Events ordering (browser + server)


Forum|alt.badge.img

Hello Amplitude community!

 

We are developing web app where we use Ampitude JS (front) + Amplitude Java SDK’s (server).

In our web app there is a registration flow with the following events:

  1. REGISTRATION_STARTED (browser)
  2. PHONE_ENTERED (browser)
  3. PHONE_SENT (browser)
  4. PHONE_CHECKED (server)
  5. SMS_SENT (server) - sms code sent to client mobile phone
  6. SMS_SENT (browser) - user enters sms code in the input and send it
  7. SMS_VALIDATED (server)
  8. REGISTRATION_SUCCEED (browser)

 

Problem: in Amplitude analytics events: 4 and 5 some times are displayed after event 8 because browser and server times are a bit different. These wrong ordering makes our funnel charts show wrong statistics.

How can we set strict event ordering as described before?

Best answer by eddie.gaona

Hello @DALLAS,

 

To my understanding, events are being ingested in a different order than expected which is affecting your Funnel views.

 

Within the SDKs you can actually control the event time to order the events.

Here is the documentation for the JS SDK.

The Java SDK is newer but here is an example on how you can set the time parameter:

In java, the Event is a class, it allowed you to set the properties.
The example:

Event event = new Event("Test Event", "test_user_id");
event.timestamp = 123;

amplitude.logEvent(event);

In this way you have control with the order of the events.

View original
Did this topic help you find an answer to your question?

eddie.gaona
Team Member
Forum|alt.badge.img+9
  • Amplitude Support
  • April 29, 2022

Hello @DALLAS,

 

To my understanding, events are being ingested in a different order than expected which is affecting your Funnel views.

 

Within the SDKs you can actually control the event time to order the events.

Here is the documentation for the JS SDK.

The Java SDK is newer but here is an example on how you can set the time parameter:

In java, the Event is a class, it allowed you to set the properties.
The example:

Event event = new Event("Test Event", "test_user_id");
event.timestamp = 123;

amplitude.logEvent(event);

In this way you have control with the order of the events.


Forum|alt.badge.img
  • New Member
  • May 3, 2022

Thank you for the answer, but is there is any other variant?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings