Server-to-server (S2S) events

Use the server-to-server (S2S) events API to send event data to Adjust using HTTP requests. Use the Adjust SDK to record your installs, sessions, and reattributions, and only send custom events using the S2S API.

If you're setting up S2S events for iOS 14+ apps, Adjust sends the conversion value to your server as an S2S response. Your server must then update the conversion values in-app. For more information on how this works, see Support for S2S events for iOS 14+.

Note:

For attribution, Adjust doesn't distinguish between clicks that are sent from the SDK and S2S clicks. They're considered the same within the attribution waterfall.

In this article, you'll learn how to set up and troubleshoot S2S event recording.

Endpoint

The S2S events API uses the following endpoint:

https://s2s.adjust.com/event

Send S2S events

The /event endpoint accepts the following requests for S2S events:

  • GET with URL parameters.
  • POST with URL parameters.
  • POST with body parameters. The Content-Type must be set to application/x-www-form-urlencoded.

Set up S2S Security

Set up S2S Security to guarantee the security of your S2S events and protect against spoofed requests. This requires each incoming request to carry a 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.

To get set up, follow the steps in the S2S Security article.

Required parameters

Important:

Parameters for S2S events are case-sensitive.

The /event endpoint requires the following parameters in each request:

  1. An advertising ID such as idfa for iOS or gps_adid for Android.
  2. An event token.
  3. An app token.
  4. A hardcoded s2s=1 parameter to inform the endpoint that the requests is server-to-server.
ParameterDescriptionExample
An advertising ID such as idfa (iOS) or gps_adid (Android)See the full list of device IDs.idfa=D2CADB5F-410F-4963-AC0C-2A78534BDF1E

gps_adid=660e1d86-6796-463a-be86-897993136018
event_tokenAdjust event token from the dashboardevent_token=f0ob4r
app_tokenAdjust app token from the dashboardapp_token=4w565xzmb54d
s2ss2s parameter set to 1s2s=1

Recommended additional parameters for event submission

For accurate event attribution, include the following parameters with your events.

Important:

For iOS devices, you should use the adid advertising ID. This enables you to match device data when the IDFA isn't available.

ParameterDescriptionExample
adidThe Adjust identifier associated with the device. Useful for identifying LAT users on iOS without IDFA information.adid=18546f6171f67e29d1cb983322ad1329
ip_addressThe IP address of the device. Used for linking events to third parties (for example: Google) and including location-related information (for example: city, postal_code) in your callbacks.

The ip_address parameter accepts only IPv4 addresses. IPv6 isn't currently supported.
ip_address=192.0.0.1
created_at_unix (recommended)

or

created_at
The date and time at which the event occurred.created_at_unix=1484085154

or

created_at=2017-01-02T15:04:05.000+0000
user_agentThe user agent of the device. Must be URL-encoded.user_agent=Mozilla%2F5.0%20%28iPhone%3B%20CPU%20iPhone%20OS%2016_6%20like%20Mac%20OS%20X%29%20AppleWebKit%2F605.1.15%20%28KHTML%2C%20like%20Gecko%29%20Version%2F16.5%20Mobile%2F15E148%20Safari%2F604.1

Event timestamp

The event timestamp can be specified using either the created_at_unix parameter or the created_at parameter.

  • created_at_unix: the UNIX timestamp at which the event was sent. For example: 1484085154.
  • created_at: A URL encoded timestamp in the ISO 8601 format. For example: 2023-01-02T15%3A04%3A05.000%2B0000
Important:

If you don't send a timestamp in your request, Adjust uses the time at which the event is received as the event date.

Make sure you check the following:

  • Events must be submitted chronologically for each device and event token according to the timestamp in the request. If Adjust receives an event with a earlier timestamp than one it previously received for the listed device and event, it rejects the event.
  • All events must be submitted within 58 days. Any events with a timestamp older than 58 days are rejected.

Share custom data

Use callback and partner parameters to send custom event data to Adjust. Callback parameters are available in your raw data exports and partner parameters are shared with your network partners.

Use the following parameters to add parameters to your requests:

  • callback_params: a URL encoded JSON object containing string key-value pairs.
  • partner_params: a URL encoded JSON object containing string key-value pairs.
Important:

Don't nest objects in your custom data objects.

Unencoded example
Encoded example
{
   "f0o": "bar",
   "bar": "baz"
}

To receive callback parameters in raw data exports, add data in the callback_params parameter of your S2S call.

curl --location https://s2s.adjust.com/event?s2s=1&event_token=f0ob4r&app_token=4w565xzmb54d&idfa=8A3CB124-5A79-4334-8802-F75FEC099C58&callback_params=%7B%22f0o%22%3A%22bar%22%2C%20%22bar%22%3A%22baz%22%7D

To send event information to your network partners, add data in the partner_params parameter of your S2S call.

curl --location https://s2s.adjust.com/event?s2s=1&event_token=f0ob4r&app_token=4w565xzmb54d&idfa=8A3CB124-5A79-4334-8802-F75FEC099C58&partner_params=%7B%22f0o%22%3A%22bar%22%2C%20%22bar%22%3A%22baz%22%7D

Record revenue events

Add the following revenue parameters to your event submissions to record S2S revenue events:

ParameterDescription
revenue

Revenue event value in full currency units
(149.99 = $149.99). Adjust's servers accept a minimum
value of 0.001 for this parameter.

currencyThe currency code associated with the event.
environmentEnvironment to post the data to
(environment=sandbox or
environment=production).
Defaults to production.

Example request

GET with URL parameters
POST with URL parameters
POST with body
curl --location 'https://s2s.adjust.com/event?s2s=1&event_token=f0ob4r&app_token=4w565xzmb54d&idfa=D2CADB5F-410F-4963-AC0C-2A78534BDF1E&created_at=2017-01-02T15%3A04%3A05Z%2B0200&callback_params=%7B%22f0o%22%3A%22bar%22%2C%20%22bar%22%3A%22baz%22%7D&partner_params=%7B%22f0o%22%3A%22bar%22%2C%20%22bar%22%3A%22baz%22%7D&currency=EUR&revenue=123.4&environment=sandbox'