At a glance: Send events from your servers to AppsFlyer to measure mobile events that occur outside the app.
Server-to-server events API for mobile
For iOS apps, starting iOS 14, you must send the os (operating system) parameter.
The AppsFlyer platform attributes and records mobile app events sent by the AppsFlyer SDK and by APIs. Use the S2S API to report events that take place outside the app; for example, a user renews their subscription using your web interface. S2S events, once recorded, are available across the platform, including dashboards, raw data, and analytics. For PBA web events see Web S2S for PBA.
AppsFlyer populates S2S events with:
- Values sent in the S2S message
- Some AppsFlyer install attribution values like, install time and media source.
To send events via API, tell your developer to follow their server-to-server events API instructions.
Populating parameters
Difference between organic and non-organic
When AppsFlyer processes S2S in-app events, attribution fields are populated by using the AppsFlyer ID to identify the associated install event that preceded the in-app events.
What this means is that some data that AppsFlyer associates with non-organic S2S in-app events, is not associated with organic S2S in-app events.
Mapping AppsFlyer ID with customer user ID (CUID)
Backend logic is required to obtain values to populate parameter. The AppsFlyer ID is mandatory and is used to attribute events. It is generated when a user first installs the mobile app.
Fetching the AppsFlyer ID
appsflyer_id is a mandatory parameter in server-to-server event messages. AppsFlyer uses this parameter to attribute the event to the original device and attributed media source.
Time stamping S2S events
When S2S events arrive in bulk to AppsFlyer, they are timestamped according to their eventTime property values and arrival time.
Sending negative revenue
Events having a negative revenue value can be sent. For example, if a purchase was canceled. The parameter af_revenue can have negative values to record this.
Including User Agent and IP address in S2S events
When sending S2S events to the metaweb_int endpoint, the payload must include the ua (User Agent) and ip (IP address) parameters. Meta requires these values to optimize campaign performance via the Conversions API (CAPI).
AppsFlyer includes ua and ip automatically for events reported through the SDK. For S2S events, advertisers must send these parameters explicitly in the request payload.
Note
In order to be measured in Incrementality, S2S events must include the advertising ID in their payload (IDFA for iOS, GAID for Android).
Increasing the volume of data transactions
When using gradual scaling, AppsFlyer can support a high volume of transactions per second (TPS) based on auto-scaling solutions.
Troubleshooting
Events aren't displaying in the dashboard
- Endpoint: Verify that the endpoint used is correct.
- Verify that the payload contains the mandatory parameters.
- Ensure that the AppsFlyer ID you are using is real and related to an actual app install.
- S2S events don't support multi-events in one S2S request. Each event must be sent as a separate event.
Events don't contain revenue
If you send S2S events but their revenue is not recorded, ensure that the JSON that you send is stringified.
Not all fields are populated in S2S events
S2S events' raw data fields are populated exclusively with the values sent in the S2S call.
S2S in-app events are wrongly attributed as organic
S2S events, such as login events, can arrive at AppsFlyer as soon as the app is installed and the SDK is started. We recommend introducing a short delay before reporting S2S in-app events that occur immediately after the install to our servers.