Audiencelab
Client-Side/React SDK/Usage

Purchase Event

Track when users make in-app purchases

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

import { sendCustomPurchaseEvent } from "@geeklab.app/audiencelab-react-web-sdk";
sendCustomPurchaseEvent(
  "item123", // id
  "Premium Subscription", // name
  9.99, // value
  "USD", // currency
  "completed" // status
)
  .then((response) => {
    console.log("Purchase event sent successfully:", response);
  })
  .catch((error) => {
    console.error("Failed to send purchase event:", error);
  });
PropTypeDefault
item_id
string
-
item_name
string
-
value
double
-
currency
string
-
status
string
-

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