Client SDKs
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 - Unity's
PlayerPrefsAPI handles local storage for the totals - Values persist across app sessions and device restarts
- The cumulative values are automatically included in event payloads as
total_purchase_valueandtotal_ad_value
Unity owns the required-reason API declaration
The plugin calls Unity's public PlayerPrefs abstraction; the Audiencelab SDK
does not invoke Apple's UserDefaults required-reason API directly. Unity owns
the underlying platform access and includes the corresponding declaration in
the Unity Engine privacy manifest. No additional required-reason API
declaration is needed for the Audiencelab SDK itself.
Use Cases
Cumulative tracking enables:
- Lifetime Value (LTV) analysis
- User segmentation by spending tier
- Cohort analysis based on revenue milestones