Overview
The Amplitude integration sends your Appstack attribution data and conversion events to your Amplitude project, so you can analyze installs, revenue and campaign performance next to your product analytics.
Appstack forwards installs through Amplitude’s Attribution API and every other event through Amplitude’s Batch Event Upload API.
| Item | Details |
|---|
| Direction | Appstack to Amplitude |
| Install events | Sent as appstack_install through the Attribution API |
| Other events | Every other event selected in the console, such as SDK in-app events and subscription events (for example RevenueCat), sent through the Batch Event Upload API with event names prefixed appstack_ |
| Revenue | Sent with any event that carries a value: revenue in the event’s own currency, plus currency and revenue_usd as event properties |
| Attribution data | Media source, campaign, adset, ad and install type, plus app ID and name, set as user properties |
| Event scope | All events or attributed events only, plus an event selector |
| Regions | US and EU Amplitude projects |
| Delivery | Scheduled sync about once an hour, not real time |
How it works
Appstack sends data to Amplitude on a schedule, and uses a different Amplitude endpoint depending on the event type.
Installs go to the Attribution API (https://api2.amplitude.com/attribution, or https://api.eu.amplitude.com/attribution for EU projects). Each install is sent on its own as a form-encoded request. This API only accepts the event type, platform, a device identifier (idfa, idfv or adid), user properties and time. Install events therefore carry no event properties, revenue, country or device ID. An install with no usable device identifier is not sent, because Amplitude would have nothing to match it on.
All other events go to the Batch Event Upload API (https://api2.amplitude.com/batch, or https://api.eu.amplitude.com/batch for EU projects). This includes purchases, revenue and the other SDK and subscription events you selected. These events carry event properties and the same attribution user properties as installs.
Event names keep the appstack_ prefix, so you can always tell Appstack data apart from your own.
Batch events carry a stable insert_id, so Amplitude can deduplicate an event that Appstack has to send again. Each upload is retried up to three times, and anything that still fails is picked up on the next sync.
Events and properties
Appstack sends two kinds of events to Amplitude.
| Event | Sent through | What it is |
|---|
appstack_install | Attribution API | A new install, attributed to a campaign or marked organic |
appstack_ + event name | Batch API | Any other event selected in the console, named in lowercase, for example appstack_purchase. Events with a value also carry revenue |
Events sent through the Batch API include these top-level fields: time, insert_id, platform, country, the user or device identifier (see How users are matched) and, on events with a value, revenue. revenue is the gross amount, before store fees, in the event’s own currency. The currency code and a USD-converted amount are sent as event properties. The event properties below are sent when Appstack has a value for them, along with the attribution properties in the next section.
Event properties
| Event property | Meaning |
|---|
event_id | Unique Appstack event identifier |
matching_type | How the event was matched to an ad click, for example network, geo, coordinates, exact_ip or city_region |
click_to_first_open_hours | Hours between the attributed click and the event. Absent when there is no click |
confidence_score | Attribution confidence: low, medium or high |
revenue_usd | Event revenue converted to USD at the exchange rate of the event date. Revenue events only |
currency | Currency code of revenue. Revenue events only |
Attribution user properties
Every event updates the same user properties on the Amplitude user, so you can segment any Amplitude chart by campaign.
| User property | Value |
|---|
appstack_media_source | The ad network, for example meta, or organic |
appstack_campaign | Campaign name, or the campaign ID when no name is available |
appstack_adset | Ad set name, or the ad set ID when no name is available |
appstack_ad | Ad name, or the ad ID when no name is available |
appstack_install_type | iOS install classification, for example new_install or reinstall_same_device. none on Android |
appstack_app_id | Your app’s Appstack app ID: the App Store ID (numbers only) on iOS, the package name on Android |
appstack_app_name | Your app’s display name |
When Appstack has no value for a property, it sends none so the property still appears in Amplitude.
How users are matched
Amplitude creates a new user whenever it receives an identifier it has not seen before. To avoid duplicate users, Appstack sends the identifiers Amplitude uses to find an existing user, and never sends a device ID alongside a user ID.
| Event | Identifier used |
|---|
appstack_install on iOS | IDFV and IDFA, when available |
appstack_install on Android | Advertising ID (GAID) and Android App Set ID, when available |
| Batch events | Your own user ID (customerUserId) as the Amplitude user ID when you provide one. Otherwise a device identifier: IDFV on iOS, advertising ID on Android (or App Set ID if enabled for your integration), and the Appstack ID as a last resort |
An install happens before your app has created a user, so Amplitude can only match it with a device identifier. Amplitude documents matching on IDFA, IDFV and advertising ID only. Appstack also sends the Android App Set ID (Android SDK 1.11.0 and later), but Amplitude does not document matching on it. Devices where the user opted out of ad tracking report an all-zero advertising ID. Appstack leaves it out, because Amplitude rejects all-zero IDs.
If your Amplitude SDK uses the Android App Set ID as its device ID (useAppSetIdForDeviceId), contact Appstack to enable the matching setting on your integration. It is off by default, is not available in the console, and only applies to Android events sent without a user ID.
To match events with your existing Amplitude users, pass the same user ID you use in Amplitude as customerUserId when you configure the Appstack SDK. Appstack then sends it with your events instead of an internal ID.
Setup
- In Amplitude, copy the API key of the project that should receive Appstack data (Organization settings → API Keys).
- In the Appstack console, open the Integrations page of your project and select Amplitude.
- In the Credentials section, select the region of your Amplitude project (United States or European Union) and paste your API key. The key can only contain letters and numbers.
- Connect the integration.
- In the Events to forward section, choose which events to send, as described below, and save.
- Optional but recommended: pass your own user ID as
customerUserId when you configure the Appstack SDK, so events match your existing Amplitude users.
An app forwards its events to one analytics destination at a time (Amplitude, Mixpanel or PostHog). Disconnect the current one before connecting another.
Choose which events to send
You control what Appstack forwards to Amplitude.
- Event selector. Pick the events you want in Amplitude from the events Appstack has received for your app: SDK events, server-to-server events and subscription events from connected providers such as RevenueCat. The install event is always sent and cannot be removed. A new connection sends only the install event until you save a selection.
- Only send attributed events. A switch, off by default. Off sends all events, including those of organic installs. On excludes events from organic installs.
Events to forward are saved separately from the credentials.
Each event Appstack sends counts toward your Amplitude event volume. If you only need installs and campaign data in Amplitude, select only the install event.
Sample payloads
These examples show what Appstack sends. All values are placeholders, and appstack_purchase stands for any event your app tracks. The Batch sample has a user_id, so it carries no device_id.
Purchase event (Batch API)
Install event (Attribution API)
This request is form encoded, with one event per request.
Limitations and troubleshooting
- Install counts can differ. Installs in Amplitude can differ slightly from Appstack or from your own install events, because matching depends on device identifiers.
- Installs show up as new users with one event. The device identifier did not match an existing Amplitude user. Possible causes are a user who opted out of ad tracking, or an Amplitude SDK that uses a device ID Amplitude cannot match on, such as the Android App Set ID. Passing
customerUserId does not help installs, because the Attribution API only matches on device identifiers.
- Some campaigns appear as IDs. When no ad network integration has resolved a name,
appstack_campaign, appstack_adset and appstack_ad hold the ID instead. Apple Search Ads is one case: Apple does not share campaign names, so appstack_campaign holds the campaign ID and appstack_media_source is apple.
- Events from before you connect are not sent. The first sync only sets the starting point. Appstack sends events that arrive after it.
- Very high event volumes can delay the sync. Appstack uploads batches of up to 1,000 events, about 35 seconds apart. Select only the events you need.
- Sync is not real time. Appstack syncs about once an hour, so new events can take over an hour to appear in Amplitude.