EconomyEvent

Introduction

  • Backend Name: economy

  • Description: The player bought, sold or exchanged something in the game

  • Event Type: Monetization

  • Priority: P1

Parameters

NameTypeSelectBackend nameDescription
additionalDataDictionaryOptionaladditional_dataAny additional information
productIDstringOptionalproduct_idThe Store SKU of the purchase unit
purchaseLocationstringOptionalplacementThe location in the app where the purchase was made
receiptStatusReceiptStatusOptionalvalidated_receiptA receipt status object
transactionTransactionRequiredtransactionTransaction object
transactionIDstringOptionaltransaction_idThe receipt ID provided by the Store

The overrides below are for convenience and internally call the function above. So the backend names are the ones from the first table.

NameTypeSelectBackend nameDescription
additionalDataDictionaryOptionaladditional_dataAny additional information
amountintRequiredamountThe amount the player BET / RAISED if applicable.
currencyTypestringOptionalThe type of currency used to buy the purchase. The default is USD
itemIDstringRequireditem_idInternal ID of an item within the game
itemTypestringRequireditem_typeThe type of item that is being interacted with, could be a spell, weapon, etc.
purchaseLocationstringOptionalplacementThe location in the app where the purchase was made

NameTypeSelectBackend nameDescription
additionalDataDictionaryOptionaladditional_dataAny additional information
productIDstringOptionalproduct_idThe Store SKU of the purchase unit
purchaseLocationstringOptionalplacementThe location in the app where the purchase was made
purchaseNamestringRequiredpurchase_nameName of the purchase/pack the user bought
realCurrencyAmountfloatRequiredthe localized price of the purchase
realCurrencyTypestringRequiredThe type of real currency (USD, Euros, etc). Lion Analytics will automatically convert the localized price based on the ‘realCurrencyType’ (currency code) provided.
receiptStatusReceiptStatusOptionalvalidated_receiptA receipt status object
transactionIDstringOptionaltransaction_idThe receipt ID provided by the Store
virtualCurrencyAmountintRequiredThe virtual Currency amount in game
virtualCurrencyNamestringRequiredThe virtual currency name used in the game
virtualCurrencyTypestringRequiredThe type of virtual currency used in the game.

Code examples:

    Product productSpent = new Product();
    Product productReceived = new Product();
    RealCurrency realCurrency = new RealCurrency("$", 25.99f);
    productSpent.realCurrency = realCurrency;
    int virtualMoneyAmount = Mathf.FloorToInt(1500f);
    List<VirtualCurrency> virtualCurrencies = new List<VirtualCurrency>
        { new VirtualCurrency("Received a Pack of : ", "$", virtualMoneyAmount) };
    productReceived.virtualCurrencies = virtualCurrencies;
    Dictionary<string, object> additionalData = new Dictionary<string, object>
    {
        { "Anything", 1356 },
        { "More Anything", 76.85f },
        { "status Something", true },
        { "Message Something", "Yes! this is good" }
    };
    LionAnalytics.EconomyEvent(virtualMoneyAmount + "Bought", productSpent, productReceived,
        "store_money_tab", "com.studio.game.money1500", "xcf22f89574u45k6jy8", additionalData,
        ReceiptStatus.Success); //Receipt status should be received either from adjust or lion's IAP package
    int virtualMoneyAmount = Mathf.FloorToInt(1500f);
    Dictionary<string, object> additionalData = new Dictionary<string, object>
    {
        { "Anything", 1356 },
        { "More Anything", 76.85f },
        { "status Something", true },
        { "Message Something", "Yes! this is good" }
    };
    LionAnalytics.InAppPurchase(virtualMoneyAmount, "Coins", "collectible", "USD", 25.99f,
        virtualMoneyAmount + "Bought", "com.studio.game.money1500", "xcf22f89574u45k6jy8", additionalData,
        "store_money_tab",
        ReceiptStatus.Success); //Receipt status should be received either from adjust or lion's IAP package
    Product productSpent = new Product();
    Product productReceived = new Product();
    RealCurrency realCurrency = new RealCurrency("$", 25.99f);
    productSpent.realCurrency = realCurrency;
    int virtualMoneyAmount = Mathf.FloorToInt(1500f);
    List<VirtualCurrency> virtualCurrencies = new List<VirtualCurrency>
        { new VirtualCurrency("Received a Pack of : ", "$", virtualMoneyAmount) };
    productReceived.virtualCurrencies = virtualCurrencies;
    Transaction transaction = new Transaction("store Transaction", "USD", productReceived, productSpent,
        "xcf22f89574u45k6jy8", "com.studio.game.money1500");
    transaction.AddSpentItem("free coins", "USD ", 0);
    transaction.AddReceivedItem("free 5 coins", "coins", 5);
    Dictionary<string, object> additionalData = new Dictionary<string, object>
    {
        { "Anything", 1356 },
        { "More Anything", 76.85f },
        { "status Something", true },
        { "Message Something", "Yes! this is good" }
    };
    LionAnalytics.EconomyEvent(transaction,
        transaction.productID, transaction.transactionID,
        "store_money_tab", additionalData,
        ReceiptStatus.Success); //Receipt status should be received either from adjust or lion's IAP package