Skip to main content

My scenario is simple:
 

  • Im sending events from the browser using the SDK (with GTM)
  • Im also sending events from the backend using webhooks 

 

How can I ensure that these events are linked to the same session/user?

Someone said use session_id - but that isnt unqiue so how would Amplitude know which user to associate the event with?

Hey @sebastianFromGrowthPod 

You need to ensure that your server side calls are sent with the user id or device id at least so that Amplitude can identify and tie these events to the proper user.

For the sessions, you will have to pass in the sessionId for your server-side calls if you want them to be included in a session. If there isn’t a session id, then these calls will appear as out of session events.
Mostly this is applicable to events sent via HTTP API and I’m not familiar of the webhook way.

You can read more on sessions here- https://help.amplitude.com/hc/en-us/articles/115002323627#h_e0307573-ebb5-4712-ad6b-0bb4c8cc6966

Here’s another post discussing sending session ID with server side events

Hope this helps.


Reply