Hello, I have not setup Amplitude in my codebase yet but am planning to use HTTP API as it seems the easiest method with our Nextjs app. I have been testing on Postman and have a rough idea what I’d be expecting in the response. However, I’m a little bit confused with passing in user_id in event’s params. For example, I’d like to track an Onboarding event flow which consists of multiple events, button clicks and page viewing whilst the user is on each page of the sign-up process. Please clarify if this should be a funnel of the Onboarding event:
- A user fills in all his details on the sign up form - tracking sign up page (pageview), get user’s device_id
- The user hits the ‘sign up’ button after filling the form - tracking button clicked, device_id sent on payload as the user does not yet have a user_id (our current app is storing user’s external_reference as the id)
- The user is directed to our ‘Connect to data source’ page, if user opts to explore sandbox or gets stuck on this page - tracking connect to data source page (pageview), user_id (external reference) is generated in this step.
- A datasource is selected to be connected - Tracking ‘connect’ button clicked, user_id and device_id added as params
- Setup final page - Tracking final sign up page (pageview) and preparing dashboard button, user_id and device_id added as params
Following each of the flow mentioned above where only the device_id is initially passed in the param, how do we update the newly generated user_id (external-reference) to merge with the device id when we want to track events after the onboarding flow?