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+.
In this article, you’ll learn how to set up and troubleshoot S2S event recording.
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 toapplication/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
The /event
endpoint requires the following parameters in each request:
- An advertising ID such as
idfa
for iOS orgps_adid
for Android. - An event token.
- An app token.
- A hardcoded
s2s=1
parameter to inform the endpoint that the requests is server-to-server.
Parameter | Description | Example |
---|---|---|
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_token | Adjust event token from the dashboard | event_token=f0ob4r |
app_token | Adjust app token from the dashboard | app_token=4w565xzmb54d |
s2s | s2s parameter set to 1 | s2s=1 |
Device IDs
Parameter | ID Type | Format |
---|---|---|
android_id | Raw Android ID | Lowercase, without hyphens |
android_id_lower_md5 | Hashed Android ID | Lowercase, MD5 |
android_id_lower_sha1 | Hashed Android ID | Lowercase, SHA1 |
android_id_upper_md5 | Hashed Android ID | Uppercase, MD5 |
android_id_upper_sha1 | Hashed Android ID | Uppercase, SHA1 |
idfv | Raw IDFV | Uppercase, with hyphens |
imei | Raw IMEI | Without hyphens |
imei_lower_md5 | Hashed IMEI | Lowercase, without hyphens |
meid | Raw MEID | Uppercase, without hyphens |
win_naid | Raw Windows network adapter ID | Lowercase, with hyphens |
win_hwid | Raw Windows Store hardware ID | Without hyphens |
Recommended additional parameters for event submission
For accurate event attribution, include the following parameters with your events.
Parameter | Description | Example |
---|---|---|
adid | The Adjust identifier associated with the device. Useful for identifying LAT users on iOS without IDFA information. | adid=18546f6171f67e29d1cb983322ad1329 |
ip_address | The 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_agent | The 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
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.
To receive callback parameters in raw data exports, add data in the callback_params
parameter of your S2S call.
To send event information to your network partners, add data in the partner_params
parameter of your S2S call.
Record revenue events
Add the following revenue parameters to your event submissions to record S2S revenue events:
Parameter | Description |
---|---|
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. |
currency | The currency code associated with the event. |
environment | Environment to post the data to:environment=sandbox or environment=production .Defaults to production . |