adjust-icon

Server-to-server (S2S) sessions

Sessions are the base of all attribution and measurement 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 record each user session in your app.

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 don’t carry the token or that carry an incorrect token are rejected by Adjust’s servers.

Record sessions

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

Headers

ParameterDescriptionExample
Content-TypeThe format of the POST payload, hardcodedapplication/x-www-form-urlencoded
X-Adjust-Forwarded-ForIP address of the device180.220.253.39
AuthorizationYour Adjust authentication token as a Bearer token.Bearer authentication_token

Payload

Find the full list of parameters in the table below.

ParameterDescriptionExample
s2s*Server-to-server parameter: enables Adjust’s servers to recognize server-side activity.
Must always be 1.
1
app_tokenUnique authentication token for your apppezwd5bre2xb
vidaVizio advertising identifier, Vizio onlydca2365e-0d78-47c6-aaac-9567846c6c9e
ridaRoku advertising identifier, Roku only
tifaTizen OS advertising identifier, Samsung only
idfaiOS advertising identifier, iOS only29DDE430-CE81-4F00-A50C-689595AAD142
idfviOS vendor identifier, iOS only59E27F41-A86B-4560-B585-63161F871C4B
gps_adidGoogle Play advertising identifier, only sent if Google Play Services library is added. Android only6cf94580-46c2-490c-b882-2f6ae269b579
oaidOpen Advertising ( Anonymous ) identifiered799bac-2537-6122-377a-edebce5db5a5
imeiInternational Mobile Equipment Identity490154203237518
android_idAndroid identifier, only sent if gps_adid isn’t present. Android onlye11a8c233efb29f3
persistent_ios_uuidSame as ios_uuid, but saved in Keychain so that re-installed apps will have same value, iOS only3b35fcfb-6115-4cff-830f-e32a248c487d
app_versionThis parameter represents build number in iOS and actual app version in Android.1.0
app_version_shortRepresents actual app version number in iOS. iOS only1.0
session_countNumber of recorded sessions including current one.1
subsession_countNumber of sub-sessions recorded. First session ever recorded (Install) doesn’t contain this parameter.
Every subsequent session contains number of sub-sessions for previous session.
1
session_lengthLength of session in seconds. First session ever recorded (Install) doesn’t contain this parameter.
Every subsequent session contains length of the previous session.
123
time_spentTime spent active during previous session123
tracking_enabledIndicates whether the user has Limit Ad Tracking enabled1
bundle_idThe bundle identifier, iOS only.com.adjust.example
package_nameThe package name, Android only.com.adjust.example
environmentsandbox for testing or production for live trafficsandbox
countryLocal country codede
languageLocal language codeen
os_nameios or androidios
os_versionCurrent version of the operating system11.0
cpu_typeProcessor family of CPUarm64-v8a
created_atTimestamp of local device, creation of the package including timezone.2024-03-23T09:46:47.288Z-0400
sent_atTimestamp of local device, sending the package including timezone.2024-03-23T09:47:47.288Z-0400
device_typeModel of the devicePhone (android), iphone
device_nameURL encoded model identifierMoto G (5) Plus, iPhone10,5
hardware_nameDevice board configurationN66AP
install_receiptCryptographically signed install receipt from App Store, iOS onlySuper long string representation of the receipt
ip_addressThe IP address of the device.
The ip_address parameter accepts only IPv4 addresses. IPv6 isn’t currently supported.
ip_address=192.0.0.1

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.

Adjust supports the following Google DMA parameters for S2S session and install requests. Adjust expects the parameters to be in request Form.

You must 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
eea
  • 1: users are in the EEA and the DMA applies
  • 0: users aren’t in the EEA and the DMA doesn’t apply
Informs Google whether users are located in the EEA and thus whether the European regulations, including the DMA, apply to this user and conversion.
ad_personalization
  • 1: user consented
  • 0: user didn’t consent
Informs whether users consented to being served personalized ads via Google Ads after installing the app.
ad_user_data
  • 1: user consented
  • 0: user didn’t consent
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.
npa
  • 1: user consented
  • 0: user didn’t consent
Informs whether users consented to being served personalized ads via Google Marketing Platform after installing the app.

Example

Request
curl -X "POST" \
-H 'Authorization: Bearer ADD_YOUR_AUTH_TOKEN_HERE' \
-H 'User-Agent: Adjust Streaming Job (akka-http)' \
-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" \
"https://s2s.adjust.com/session"
Response
{
"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"]
}
}