Amplitude Sessions and Attribution

  • 23 September 2022
  • 4 replies

Hello Everybody my question(s) is as followed :)


Scenario let’s say a user lands on a landing page from an ad with all the UTM parameters in place and does the following: (please note that all the following are tracked with Segment)

  1. Page View(anonymous → tracked with Segment cloud Javascript Integration) on subdomainA
  2. Lead Submitted( identified →  on subdomainA ) server side segment cloud
  3. Page view (identified → subdomainB) javascript segment cloud
  4. checkout started (identified → subdomainB) javascript segment cloud
  5. order completed (identified → subdomainB) server side segment cloud
  6. meeting calendar viewed and booked (identified → subdomainB) server side segment cloud


In addition to that, my session settings are that they are grouped together by session id.


I noticed the following behavior for starters; that the client side events that were happening on subdomainA have the same session ID, and that the client side tracked events that happened on subdomainB are grouped by a seperate session ID. 


I also noticed that the server side tracked cloud events from Segment, all have session ID as “-1”.


My 3 questions are as follow:


Question 1: Even though there are 3 different sessions created (that really all belong to the same session and are all accomplished within 30 minutes), if the UTM parameters are only sent on the very first page view of Step 1. Will all the subsequent events and conversion still be attributed to those initial UTM parameters? 


Question 1b: let’s say if that same user 4 days later, performs additional conversion events for different products, after coming from a different UTM source. Will those latest events be attributed to the latest UTM parameters? or to the initial?


Question 2: if the answer to my first question is no, is there a way inside of amplitude that I can stitch the 3 sessions together? Ideally I would like group all the events performed by a single user with a single user ID( given that anonymousID will be merged retroactively), in a 30 minute timeout window. How would I accomplish this? I already tried changing the sessionID parameter to the userID, but when doing this, and testing out events, there are no sessions created at all….



Thank you so much for taking the time to read this!!


Best answer by eddie.gaona 26 September 2022, 18:59

View original

4 replies

Userlevel 5
Badge +9

Hello @adeola13 happy to help!


  1. It will all depend on when the events were sent to Amplitude. The properties are set when a user access a page for the first time within a session and there are UTM parameters in the URL. All the events within that session will contain the UTM parameters. However, the other events in different sessions we can’t say that for sure if they happen before/after the event that assigns the UTM parameters. 
  2. If a user comes in 4 days later in a different session with different UTM parameters then the UTM values will stay the same. However, the properties prefixed with initial will remain constant. More information on this can be found, here.
  3. I would advise reaching out to Segment Support to help you mitigate the Session IDs to Amplitude. The way to keep events within the same session would be to have the same Session ID across all of your events. When using Amplitude directly you can call getSessionID() and use that value for the server-side events. Not sure how that would look with Segments SDKs.

Hey @eddie.gaona thank you for your response! Appreciate it a lot.


For question 1: if they happen within the event time out window that I have specified in my case 30 minutes, if the server side events that have no sessionID( such as purchase, and form completed,) if they occur within 30 minutes, is there a way I could attribute the session to the same session?

For example, I know that with a competitor won’t name them here, but the way they define sessions is if the events of any given user occur within a certain time window, is there a way I could accomplish the same in Amplitude?

Userlevel 5
Badge +9

Hello @adeola13 ,

You can go into your project settings are remove any property that is being considered as the Session Property. Then the only item that is taken into account is the time between events.


This is wonderfull!! Thank you so much :) @eddie.gaona