Cumulative Value Tracking
Track lifetime purchase and ad revenue
Version:
The SDK maintains running totals for purchase and ad revenue, stored locally on the device. These values are automatically included in event payloads.
Get Total Purchase Value
double totalPurchases = AudiencelabSDK.GetTotalPurchaseValue();
Debug.Log($"Lifetime revenue: ${totalPurchases:F2}");Get Total Ad Value
double totalAdRevenue = AudiencelabSDK.GetTotalAdValue();
Debug.Log($"Lifetime ad revenue: ${totalAdRevenue:F2}");How It Works
- Each time you call
SendPurchaseEvent()orSendAdEvent(), the SDK adds the value to the running total - The totals are stored locally using Unity's PlayerPrefs
- Values persist across app sessions and device restarts
- The cumulative values are automatically included in event payloads as
total_purchase_valueandtotal_ad_value
Use Cases
Cumulative tracking enables:
- Lifetime Value (LTV) analysis
- User segmentation by spending tier
- Cohort analysis based on revenue milestones