You should record transactions or purchases in CleverTap using a special event called Charged.
What makes Charged a special event?
-
Charged is a special event because it provides a way for you to specify the items sold, their categories, transaction amount, the transaction id, and the information about your users.
-
Recording a purchase against a user marks them as a customer in CleverTap. This enables you to compare your funnel reports between customers and non-customers.
-
Recording Items Sold
To record a list of items sold, you should use the Items collection. See the code sample below. Along with the product name, you can also add properties like size, color, category etc. -
Recording the Transaction Amount
The transaction total or subscription charge should be recorded in an event property called Transaction value.Parameter Type Description event_id string Used to map the event. transcation_value string The value being attributed to the revenue. variant_id string The variant fro whcih transaction is taking place. type string Type of event (Charged, custom, system) currency string Link to product page imageUrl string Link to product image transaction_id string Product vendor -
event_id": "1234", {to map the event}Mandatory properties to send a charged event-
transaction_value": 29.98,{to attribute the value}
variant_id": "1111",
email": "[email protected]",
phone_number: +91 7877560448
currency:
time:
type: (charged, custom, system)
transaction_id :12345
product_id:111
{ "token": "Private_API_KEY", "event": "Placed_Order", "type": "charged", "customer_properties": { "email": "[[email protected]](mailto:[email protected])", "first_name": "John", "last_name": "Smith", "phone_number": "5551234567", "address1": "123 Abc st", "address2": "Suite 1", "city": "Boston", "zip": "02110", "region": "MA", "country": "USA" }, "properties": { "event_id": "1234", "transaction_value": 29.98, "transaction_Id": "1234", "currency": "1234", "OrderId": "1234", "Categories": ["Fiction", "Classics", "Children"], "ItemNames": ["Winnie the Poohqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq", "A Tale of Two Cities"], "Brands": ["Kids Books", "Harcourt Classics"], "DiscountCode": "Free Shipping", "DiscountValue": 5, "Items": [{ "variant_ID": "1111", "Quantity": 1, "ItemPrice": 9.99, "RowTotal": 9.99 }, { "variant_id": "1112", "Quantity": 1, "ItemPrice": 19.99, "RowTotal": 19.99 } ], "BillingAddress": { "FirstName": "John", "LastName": "Smith", "Company": "", "Address1": "123 abc street", "Address2": "apt 1", "City": "Boston", "Region": "Massachusetts", "RegionCode": "MA", "Country": "United States", "CountryCode": "US", "Zip": "02110", "Phone": "5551234567" }, "ShippingAddress": { "FirstName": "John", "LastName": "Smith", "Company": "", "Address1": "123 abc street", "Address2": "apt 1", "City": "Boston", "Region": "Massachusetts", "RegionCode": "MA", "Country": "United States", "CountryCode": "US", "Zip": "02110", "Phone": "5551234567" } }, "time": 1387302423 }
-
Advantages of the Charged Event
- Helps you identify your customers, and how are they using your app or website
- Run campaigns to reward loyal users or get lost customers back
- Measure customer loyalty via running a cohort analysis on repeat purchases
- Analyze paid campaign performance by total revenue earned
- Get revenue insights like – total revenue, number of transactions, count of paying users and much more.