Repository navigation
0.3.0
New Features
AlbySDK
- Introduced
AlbySDKas 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, andtestDescriptionparameters toAlbyInlineWidgetandAlbyWidgetScreen
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.