Server-to-server (S2S) sessions

Sessions are the base of all attribution and tracking in Adjust. They trigger when a user resumes using an app from the background or when they open the app. Use the S2S Session API to track each user session in your app.

Warning:
Adjust needs to turn this feature on for you. Contact your Technical Account Manager or support@adjust.com to proceed.

Before you begin

Authentication

Set up S2S Security to guarantee the security of your S2S sessions and protect against spoofed requests. This requires each incoming request to carry an authentication token generated in your Adjust dashboard. Requests that do not carry the token or that carry an incorrect token are rejected by our server.

Session tracking

Adjust groups sessions to save resources. This means there must be a gap of at least 30 minutes after a session, before the Adjust server accepts a new session as triggered.

Endpoint

https://s2s.adjust.com/session

POST header

Requirements:

Parameter NameDescriptionExample
Content-TypeThe format of the POST payload, hardcodedapplication/x-www-form-urlencoded
X-Adjust-Forwarded-ForIP address of the device180.220.253.39
Authorization When you call Adjust APIs, send the value of your Adjust authentication token with the authentication type set as Bearer. Bearer authentication_token

POST Payload

Parameters

Request example

cURL
curl -X 'POST' -d 'app_token=a1234b2x3a4o&app_version=Roku%2FDVP-10.5+%2810.5.0.0010%29&created_at_unix=1543915806015&environment=production&os_name=android&rida=099aa0bc-d123-4567-8999-a1b7c50767b1&s2s=1' -H 'Authorization: Bearer ADD_YOUR_AUTH_TOKEN_HERE' -H 'User-Agent: Adjust Streaming Job (akka-http)' 'https://s2s.adjust.com/session'

Response

JSON
{
    "Host": "s2s.adjust.com",
    "Path": "/session",
    "Method": "POST",
    "ReceivedAt": "2022-01-01T17:00:01.030986068Z",
    "Header": {
        "Connection": [
            "close"
        ],
        "User-Agent": [
            "Adjust Streaming Job (akka-http)"
        ],
        "Authorization": [
            "Bearer ADD_YOUR_AUTH_TOKEN_HERE"
        ],
        "Content-Length": [
            "0"
        ],
        "X-Adjust-Forwarded-For": [
            "71.142.112.183",
            "34.221.136.124"
        ],
        "X-Adjust-Forwarded-Proto": [
            "https"
        ]
    },
    "Form": {
        "s2s": [
            "1"
        ],
        "rida": [
            "099aa0bc-d123-4567-8999-a1b7c50767b1"
        ],
        "os_name": [
            "android"
        ],
        "app_token": [
            "a1234b2x3a4o"
        ],
        "app_version": [
            "Roku/DVP-10.5 (10.5.0.0010)"
        ],
        "environment": [
            "production"
        ],
        "created_at_unix": [
            "1543915806015"
        ]
    }
}

Provide consent data to Google (Digital Markets Act compliance)

To comply with the EU's Digital Markets Act (DMA), Google Ads and the Google Marketing Platform require explicit consent to receive Adjust’s attribution requests to their APIs.

Important:

Passing these options is required if you use Google Ads or Google Marketing Platform and have users located in the European Economic Area (EEA).

Adjust supports the following Google DMA parameters for S2S session and install requests. We expect the parameters to be in request Form. Note that you need to send the ad_personalization parameter if you are working with Google Ads, and the npa parameter if you are working with Google Marketing Platform.

KeyValueDescription
eea1 = users are in the EEA and the DMA applies

0 = users are not in the EEA and the DMA does not apply
The eea parameter informs Google whether users are located in the EEA and thus whether the European regulations, including the DMA, apply to this user and conversion. The parameter type is boolean.
ad_personalization1 = user consented

0 = user did not consent
  • For Google Ads

The ad_personalization parameter informs whether users consented to being served personalized ads via Google Ads after installing the app, i.e. whether Google can retarget the users.
ad_user_data1 = user consented

0 = user did not consent
The ad_user_data parameter informs Google whether users granted consent to personal data being shared for measurement purposes or not. The consent applies to all the Core Platform Services (CPS) advertisers have specified in their Google Ads and Google Marketing Platform UI.
npa1 = user did not consent

0 = user consented
  • For Google Marketing Platform

The npa parameter informs whether users consented to being served personalized ads via Google Marketing Platform after installing the app, i.e. whether Google can retarget the users.