Overview

Amply SDK provides a comprehensive solution for mobile analytics and campaign management. This guide explains the core concepts and how they work together.

Architecture

The SDK is built using Kotlin Multiplatform (KMP), allowing shared business logic across Android and iOS while providing native platform integrations where needed.

┌─────────────────────────────────────────────────────┐
│                   Your Application                  │
├─────────────────────────────────────────────────────┤
│                     Amply SDK                       │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐  │
│  │   Events    │  │  Sessions   │  │  Campaigns  │  │
│  └─────────────┘  └─────────────┘  └─────────────┘  │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐  │
│  │   Storage   │  │   Network   │  │   Actions   │  │
│  └─────────────┘  └─────────────┘  └─────────────┘  │
├─────────────────────────────────────────────────────┤
│              Platform (Android / iOS)               │
└─────────────────────────────────────────────────────┘

Core Components

Event Tracking

Events are the foundation of Amply's analytics. Every user action, screen view, or system event can be tracked and used for analysis and campaign targeting.

Events are:

  • Timestamped using server-synchronized time

  • Stored locally for reliability

  • Batched and sent to the server

  • Available for campaign rule evaluation

Session Management

Sessions group user activity into logical units. The SDK automatically:

  • Starts a new session when the app launches

  • Tracks session duration and event counts

  • Ends sessions after configurable inactivity timeout

  • Maintains session counters across app restarts

Campaigns

Campaigns deliver targeted experiences to users based on their behavior and device characteristics. Each campaign consists of:

  • Targeting Rules - Who should see the campaign (device type, user properties, etc.)

  • Triggering Rules - When the campaign should activate (specific events, event counts, etc.)

  • Actions - What happens when triggered (deep links, rate reviews, etc.)

Datasets

Datasets provide context for campaign rule evaluation. The SDK collects and maintains several datasets:

Dataset
Prefix
Description

Device

@device

Device properties (model, OS, IDFA, etc.)

User

@user

User-level properties

Session

@session

Current session data (counter, duration)

Triggered Event

@triggeredEvent

The event that triggered evaluation

Events

@events

Historical event data and counters

Data Flow

1

Initialization

SDK loads configuration and syncs server time.

2

Session Start

New session begins, SDK_INITIALIZED event fires.

3

Event Tracking

Your app tracks events as users interact.

4

Campaign Evaluation

Each event triggers campaign rule evaluation.

5

Action Execution

Matching campaigns execute their actions.

6

Data Sync

Events are batched and sent to the server.

Last updated