Session management

In the user management documentation you can read about how users are defined. These users perform several visits, which we call sessions.

A session is terminated after 30 minutes of inactivity. It is however possible to change this default length of 30 minutes. For more information read about account settings.

How does it work?

  1. An event is triggered by the user. This could be a pageview or any other type of event.
  2. Harvest Collect receives the event and processes the event.
  3. During processing, Harvest Collect checks for the harvest_session cookie.

4a. If the cookie does not exist, a unique ID will be created, the session ID and a new session is started. 5a. Harvest Collect saves the sessionID with some other information in the harvest_session cookie.

4b. If the cookie exists, Harvest Collect will do several checks to see whether a new session needs to be generated.

5b. If we need a new session, a unique ID will be created, the sessionID and a new session is started. 6b. Harvest Collect saves the sessionID with some other information in the harvest_session cookie.

5c. If we do not need a new session, the harvest_session is resaved to reset the timeout.

A new session will be created in the following situations:

  1. There was no harvest_session cookie or no sessionID
  2. There is a new combination of source and medium
  3. There is a new campaign
  4. There is a new gclid (Google Click ID of Google Ads)
  5. There is a new referrer

A session expires after 30 minutes of inactivity.

Origin of the source and medium

Source and medium are determined based on the following rules:

utm-parameters

When a page url contains the parameter utm_source and utm_medium, then these values will be used to determine which source and medium the user originated from.

An example could be:

harvest.graindata.com/landingpage.html?utm_source=facebook&utm_medium=social_paid

The above example is a landing page url to which an ad on Facebook linked.

gclid

If you click on an ad of Google Ads, it is possible to add a gclid parameter. An example could be:

harvest.graindata.com/landingpage.html?gclid=1231231283sdfsdf8123

When we detect the gclid, we know that the source = google and the medium = search_paid.

social referrer

We check the referrer second level domain (facebook in www.facebook.com or twitter in www.twitter.com) to the following list:

Second level domain source
facebook facebook
t twitter
twitter twitter
linkedin linkedin
instagram instagram
pinterest pinterest

If there are no utm-parameter and the referrer matches to the following list, we know that the medium = social_organic.

search referrer

We check the referrer second level domain to the following list:

Second level domain source
google google
yahoo yahoo
googleapis google
duckduckgo duckduckgo
bing bing
ask ask

If there are no utm-parameter and the referrer matches to the following list, we know that the medium = search_organic.

referral

When there are no utm-parameters and we cannot find a match in social and search referrers, the source will equal the url of the referrer and the medium = referral.

This is sort of the rest category.

direct

When there is no referral, the session is stared by source = none and medium = direct. This can happen whe na user types in the URL directly or bookmarked the page.

Campaign tracking

Campaign tracking is one of the most important aspects of sessions. Read more about this in our campaign tracking documentation.