Audiencelab
Server-Side/Python SDK/Usage

Purchase Event

How to send purchase events

Use PurchaseData and AppEvent to send a purchase event when the user completes an in-app purchase.

Send this event every time a user completes a transaction.

purchase_data = PurchaseData() \
    .set_item_id("item_123") \
    .set_item_name("No Ads") \
    .set_value(3.99) \
    .set_currency("usd") \
    .set_status("completed")

purchase_event = AppEvent(client, purchase_data, user_data)
try:
    response = purchase_event.send()
    print("Purchase event sent.")
except Exception as e:
    print("Error sending purchase event:", e)
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.