Client-SideUnity SDKFeatures

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. The totals are stored locally using Unity's PlayerPrefs
  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

Use Cases

Cumulative tracking enables:

  • Lifetime Value (LTV) analysis
  • User segmentation by spending tier
  • Cohort analysis based on revenue milestones