Required to have a value for transactionName
UnityEngine.Debug:LogError (object)
Unity.Services.Analytics.AnalyticsServiceInstance:Transaction (Unity.Services.Analytics.TransactionParameters) (at Library/PackageCache/com.unity.services.analytics@4.1.0/Runtime/Events/Transaction/AnalyticsServiceInstance.Transaction.cs:19)
UnityEngine.GUI:CallWindowDelegate (UnityEngine.GUI/WindowFunction,int,int,UnityEngine.GUISkin,int,single,single,UnityEngine.GUIStyle)
i am having this error when i click fake store buy button.
There is one more subject about that bug but i couldnt see any solution. What should i do?
Most of the parameters on an event are optional, but there are certain parameters that are required in order for the event to provide meaningful data that you can then use to fine tune and imporve your game. In the case of the transaction event, the transactionName is required, by populating it you will be able to analyze your data and answer questions related to different products.
You can view the details of each event and determine the names, type and requirement condition of each parameter within an event from the Analytics > Event Manager.
If you don’t have a valid name for a transaction, you could set the transactionName to “UNKNOWN” or something like that, but don’t leave it null as this will cause the event to fail validation as the expected parameter was missing.
Here’s some more information on manually recording a transaction event. If you are using the IAP plugin, it will send this event for you automatically.
var productsReceived = new Unity.Services.Analytics.Product()
{
Items = new List<Item>()
{
new Item(){ ItemName = "Golden Battle Axe" , ItemType = "Weapon", ItemAmount = 1},
new Item(){ ItemName = "Flaming Sword" , ItemType = "Weapon", ItemAmount = 1},
new Item(){ ItemName = "Jewel Encrusted Shield" , ItemType = "Armour", ItemAmount = 1}
},
VirtualCurrencies = new List<VirtualCurrency>()
{
new VirtualCurrency(){ VirtualCurrencyName = "Gold", VirtualCurrencyType =VirtualCurrencyType.PREMIUM, VirtualCurrencyAmount = 100}
}
};
var productsSpent = new Unity.Services.Analytics.Product()
{
RealCurrency = new RealCurrency() { RealCurrencyType = "USD", RealCurrencyAmount = 499 }
};
AnalyticsService.Instance.Transaction(new TransactionParameters()
{
ProductsReceived = productsReceived,
ProductsSpent = productsSpent,
TransactionID = "100000576198248",
TransactionName = "IAP - A Large Treasure Chest",
TransactionType = TransactionType.PURCHASE,
TransactionServer = TransactionServer.APPLE,
TransactionReceipt = "ewok9Ja81............991KS=="
});
If you are using the IAP plugin but aren’t using the Services > In-App Purchaing > IAP Catalogue tool in the editor to populate the catalogue, you will instead need to populate the catalogue in code and provide your own button.
e.g.
// Manually add a couple of items to the store catalogue
var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
builder.AddProduct("coins_500", ProductType.Consumable);
builder.AddProduct("coins_1000", ProductType.Consumable);
// Initialize store
UnityPurchasing.Initialize(this, builder);
public void Coin500_Button_Clicked()
{
GameManager.Instance.Log("Attempting to buy 500 coins");
GameManager.Instance.iapManager.Purchase("coins_500");
}
public void Purchase(string productId)
{
controller.InitiatePurchase(productId);
}
The product id is case sensitive, it must match the product id you have added in your Google or Apple IAP definition in their store console.
The transaction name, value, receipt, price etc… will be populated in the transaction analytics event automatically, using values returned in the store response to your purchase.