Client-SideAngular SDKUsage

Purchase Event

Track when users make in-app purchases in Angular

Use sendCustomPurchaseEvent to send a purchase event when a user completes an in-app purchase.

await this.audienceLab.sendCustomPurchaseEvent(
  "item123",
  "Premium Upgrade",
  9.99,
  "USD",
  "completed"
);
PropTypeDefault
id
string
-
name
string
-
value
number
-
currency
string
-
status
string
-

Status Field Values

Use "Completed" for successful purchases and "Failed" for failed transactions. While the SDK doesn't enforce these values, using different status names may impact attribution accuracy.

For questions about status values, you can reach out to our support team.

Item ID

The item_id parameter should represent the unique identifier for the product or item being purchased, not the transaction ID. Using the correct product identifier ensures proper tracking and attribution of purchases in your analytics.

Purchase events help attribute revenue to campaigns and creatives, enabling optimization of your monetization funnel.