Skip to main content

Overview

The Event Ingestion API accepts structured events from the AppDNA SDKs. Events are batched on the client, sent to the ingestion endpoint, and processed through the analytics pipeline into BigQuery for querying and dashboards.

Endpoints

Ingest Events

POST /api/v1/ingest/events
Authentication: SDK Key (x-api-key header) Accepts a batch of events from the SDK. Each event follows the envelope schema defined below. Request body:
{
  "events": [
    { ... },
    { ... }
  ]
}
Response:
{
  "accepted": 20,
  "rejected": 0
}

Identify User

POST /api/v1/ingest/identify
Authentication: SDK Key (x-api-key header) Links an anonymous device to a known user ID. Call this when the user logs in or creates an account. Request body:
{
  "anon_id": "550e8400-e29b-41d4-a716-446655440000",
  "user_id": "user-12345"
}

Health Check

GET /api/v1/ingest/health
Authentication: None (public) Returns the health status of the ingestion service.

Event Envelope Schema

Every event sent to the ingestion API must conform to the EventSchema envelope:
{
  "schema_version": 1,
  "event_id": "550e8400-e29b-41d4-a716-446655440000",
  "event_name": "purchase_completed",
  "ts_ms": 1708344000000,
  "user": {
    "anon_id": "660e8400-e29b-41d4-a716-446655440001",
    "user_id": "user-12345"
  },
  "device": {
    "platform": "ios",
    "os": "17.0",
    "app_version": "1.0.0",
    "sdk_version": "1.0.0",
    "bundle_version": 0,
    "locale": "en_US",
    "country": "US"
  },
  "context": {
    "session_id": "770e8400-e29b-41d4-a716-446655440002"
  },
  "properties": {
    "product_id": "premium_monthly",
    "price": 9.99,
    "currency": "USD"
  },
  "privacy": {
    "consent": {
      "analytics": true
    }
  }
}

Field Reference

FieldTypeRequiredDescription
schema_versionnumberYesSchema version, currently 1
event_idstring (uuid)YesUnique event identifier, generated by the SDK
event_namestringYesName of the event
ts_msnumberYesUnix timestamp in milliseconds
user.anon_idstring (uuid)YesAnonymous device identifier
user.user_idstringNoKnown user identifier (set after identify)
device.platformstringYesios or android
device.osstringYesOS version
device.app_versionstringYesHost app version
device.sdk_versionstringYesAppDNA SDK version
device.bundle_versionnumberYesConfig bundle version currently active
device.localestringYesDevice locale (e.g., en_US)
device.countrystringYesISO country code
context.session_idstring (uuid)YesCurrent session identifier
propertiesobjectNoArbitrary key-value pairs for the event
privacy.consent.analyticsbooleanYesWhether the user has consented to analytics
Events where privacy.consent.analytics is false are accepted but not processed into analytics pipelines. They are retained only for audit purposes.

Auto-Tracked Events

The AppDNA SDKs automatically track the following events without any additional code. These events are fired across all four SDKs (iOS, Android, Flutter, React Native):

Session Events

Event NameTrigger
session_startApp enters foreground or new session begins
session_endApp enters background or session times out
app_openApp launched
app_closeApp terminated

Push Notification Events

Event NameTrigger
push_token_registeredDevice push token obtained
push_permission_grantedUser grants push permission
push_permission_deniedUser denies push permission
push_deliveredPush notification delivered to device
push_tappedUser taps a push notification

Purchase Events

Event NameTrigger
purchase_startedUser initiates a purchase flow
purchase_completedPurchase transaction succeeds
purchase_failedPurchase transaction fails
purchase_canceledUser cancels during purchase
purchase_pendingPurchase is pending (e.g., Ask to Buy)
restore_startedUser initiates a purchase restore
restore_completedPurchase restore succeeds

Onboarding Events

Event NameTrigger
onboarding_flow_startedUser enters an onboarding flow
onboarding_step_viewedOnboarding step rendered on screen
onboarding_step_completedUser completes an onboarding step
onboarding_flow_completedUser finishes all onboarding steps
onboarding_flow_dismissedUser skips or dismisses onboarding

Paywall and Experiment Events

Event NameTrigger
paywall_viewPaywall displayed to user
paywall_closeUser dismisses paywall
experiment_exposureUser exposed to an experiment variant

Other Events

Event NameTrigger
survey_shownSurvey presented to user
survey_completedUser submits a survey
survey_dismissedUser dismisses a survey
web_entitlement_activatedWeb-based entitlement activated
web_entitlement_expiredWeb-based entitlement expired
deferred_deep_link_resolvedDeferred deep link resolved on first launch

Batching Behavior

The SDK batches events on the client to minimize network overhead:
SettingDefault ValueDescription
Batch size20 eventsEvents are flushed when the batch reaches this size
Flush interval30 secondsEvents are flushed on this interval regardless of batch size
Events are also flushed immediately when the app enters the background, ensuring no data loss during session transitions.

Webhook Triggers

Certain ingestion events automatically trigger webhooks if configured on your account:
Webhook EventTriggered By
onboarding.startedonboarding_flow_started event ingested
onboarding.completedonboarding_flow_completed event ingested
experiment.exposureexperiment_exposure event ingested
user.identified/api/v1/ingest/identify called
Webhook delivery is asynchronous and does not affect ingestion latency. See the Webhooks documentation for payload format and retry policy.