1

I want to redirect the user after the track event or any other event fired by rudderstack has be done.

As I've tested on track event it doesn't not return a promise.

How can I wait for the requests to end to redirect after?

Below there is an example of what i am doing:

// import    
import { track, load, ready, identify } from 'rudder-sdk-js';
[...]

await load(write_key, data_plane_url)

await ready(async () => {
  await identify(hashedId, userInfo);

  await track('ORDER_APPROVED');    
});

history.push('/some-page')

I'm using it with React btw.

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
Uriel Carneiro
  • 390
  • 3
  • 15

0 Answers0