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"
        ]
    }
}