Skip to content

Purchase Events

GetSocial SDK supports tracking purchases users make in your application. The gathered data is shown in Revenue Analytics section.

Automatic tracking

In order to automatically track purchases, follow the setup guide here.

Manual tracking

If you don’t want to use automated tracking, you can report purchase events on your own.

val purchaseData = new PurchaseData()
    .withProductId(product_id)
    .withProductTitle(product_title)
    .withProductType(product_type) // Item or subscription
    .withPrice(product_price)
    .withPriceCurrency(price_currency)
    .withPurchaseId(purchase_id)
    .withPurchaseDate(purchase_date)

Analytics.trackPurchaseEvent(purchaseData)
var purchaseData = PurchaseData()
purchaseData.productId = // product id
purchaseData.productType = ProductType.Item.rawValue // item or subscription
purchaseData.productTitle = // product title
purchaseData.price = // product price
purchaseData.priceCurrency = // price currency
purchaseData.purchaseDate = // purchase date
purchaseData.transactionIdentifier = // unique transaction id

Analytics.trackPurchase(purchaseData)
var purchaseData = new PurchaseData();
purchaseData.ProductId = // product id
purchaseData.PurchaseType = // item or subscription
purchaseData.ProductTitle = // product title
purchaseData.Price = // product price
purchaseData.PriceCurrency = // price currency
purchaseData.PurchaseDate = // purchase date
purchaseData.PurchaseId = // unique transaction id

Analytics.TrackPurchase(purchaseData);
PurchaseData purchaseData = PurchaseData(
    'id', // product id, 
    type, // item or subscription, 
    'title', // product title,
    price, // product price, 
    currency, // price currency 
    date, // purchase date
    purchaseId // unique transaction id
);
Analytics.trackPurchaseEvent(purchaseData);

Give us your feedback! Was this article helpful?

😀 🙁