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

  1. Each time you call SendPurchaseEvent() or SendAdEvent(), the SDK adds the value to the running total
  2. Unity's PlayerPrefs API handles local storage for the totals
  3. Values persist across app sessions and device restarts
  4. The cumulative values are automatically included in event payloads as total_purchase_value and total_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