Skip to content

0.3.0

Choose a tag to compare

@jasondeng jasondeng released this 29 Jan 16:30
· 26 commits to main since this release
5401f08

New Features

AlbySDK

  • Introduced AlbySDK as a singleton instance.
  • Access via AlbySDK.initialize() to ensure a single point of entry for configuration and usage.

Tracking Events

  • Added Purchase Pixel tracking event.
  • Added Add to Cart tracking event.

A/B Testing Details

  • Added A/B Test Support with testId, testVersion, and testDescription parameters to AlbyInlineWidget and AlbyWidgetScreen

Usage

Application Initialization

To initialize AlbySDK in an Android application, update your Application subclass:

import android.app.Application
import com.alby.widget.AlbySDK

class YourApplication : Application() {
    override fun onCreate() {
        super.onCreate()

        /* ... */
        
        // Initialize is required before invoking any other Alby SDK functionality 
        AlbySDK.initialize("your-brand-id", this)
    }
}

Tracking Events

To track an Add to Cart event:

AlbySDK.sendAddToCartEvent(
    price = 99.99, // Price of the item
    variantId = "A123", // Variant ID of the item
    currency = "USD", // Currency of the item
    quantity = "1" // Quantity of the item
)

To track a Purchase event:

AlbySDK.sendPurchasePixel(
    orderId = 12345, // Order ID (String or Number)
    orderTotal = 99.99, // Order total (Float or Number)
    productIds = listOf("A123", 456), // List of product IDs (String or Number)
    currency = "USD" // Currency of the order
)

Notes

  • Ensure AlbySDK.initialize() is called before any tracking events or embedding any Alby widget.
  • Events are sent asynchronously for minimal impact on performance.