FalconMetrics SDK for Android

FalconMetrics is a lightweight analytics and attribution tracking SDK for Android applications. This SDK allows you to track various user events and conversions in your Android app to measure marketing effectiveness and user engagement.

Features

  • Easy integration with minimal setup
  • Event tracking for user actions (sign-ups, purchases, etc.)
  • Privacy-compliant with opt-out capabilities
  • Efficient background processing with minimal battery impact
  • Automatic install referrer tracking

Installation

Gradle

Add the FalconMetrics SDK to your app's build.gradle file:

dependencies {
    implementation 'io.falconmetrics:falconmetrics:0.1.12'
}

Usage

Initialization

Initialize the SDK in your Application class or main activity:

// In your Application class
class MyApp : Application() {
    
    lateinit var falconMetrics: FalconMetrics
    
    override fun onCreate() {
        super.onCreate()
        
        // Create the FalconMetrics instance
        falconMetrics = FalconMetricsSdk.create(applicationContext)
        
        // Initialize with your API key
        falconMetrics.init("YOUR_API_KEY")
    }
}

Tracking Events

The SDK supports tracking various event types:

User Sign-Up or Login

// Track when a user signs up or logs in
falconMetrics.trackEvent(UserSignedUpOrLoggedInEvent())

Add to Cart Event

// Track when a user adds an item to cart
falconMetrics.trackEvent(
    AddedToCartEvent(
        itemId = "product-123",
        quantity = 2,
        productPriceInCents = 1099, // $10.99
        currency = "USD",
        productCategory = "Electronics",
        cartId = "cart-456"
    )
)

Coupon Applied Event

// Track when a user applies a coupon
falconMetrics.trackEvent(
    CouponAppliedEvent(
        couponCode = "SUMMER20",
        cartId = "cart-456"
    )
)

Purchase Event

// Track when a user completes a purchase
falconMetrics.trackEvent(
    PurchaseEvent(
        itemId = "product-123",
        quantity = 2,
        transactionId = "order-789",
        productPriceInCents = 1099, // $10.99
        currency = "USD",
        revenueInCents = 2198, // $21.98
        productCategory = "Electronics",
        cartId = "cart-456",
        paymentMethod = "credit_card",
        taxInCents = 175, // $1.75
        shippingCostInCents = 499, // $4.99
        discountInCents = 220 // $2.20
    )
)

Privacy Control

The SDK provides methods to enable or disable tracking based on user consent:

// Disable tracking
falconMetrics.setTracking(context, false)

// Check if tracking is enabled
val isEnabled = falconMetrics.isTrackingEnabled(context)

// Re-enable tracking
falconMetrics.setTracking(context, true)

By default, tracking is enabled when the SDK is initialized.

ProGuard Configuration

The SDK includes consumer ProGuard rules, so you don't need to add any additional ProGuard configuration to your project.

Requirements

  • Android API level 21 (Android 5.0) or higher
  • Kotlin 1.5 or higher

License

© 2025 FalconMetrics LLC. All rights reserved.

This SDK is licensed under the FalconMetrics SDK License Addendum. Use of this SDK is subject to the FalconMetrics Terms of Use and SDK License, available at: https://www.falconmetrics.io/terms

Support

For questions or support, please contact [email protected].