docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class TransactionEvent

    Use this class to record transaction events.

    For more information about the transaction event, see the documentation page: https://docs.unity.com/ugs/en-us/manual/analytics/manual/record-transaction-events

    Inheritance
    object
    Event
    TransactionEvent
    TransactionFailedEvent
    Inherited Members
    Event.SetParameter(string, string)
    Event.SetParameter(string, bool)
    Event.SetParameter(string, int)
    Event.SetParameter(string, long)
    Event.SetParameter(string, float)
    Event.SetParameter(string, double)
    Event.SetParameter(string, DateTime)
    Event.ParameterHasBeenSet(string)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Services.Analytics
    Assembly: Unity.Services.Analytics.dll
    Syntax
    public class TransactionEvent : Event

    Constructors

    TransactionEvent()

    Creates a new TransactionEvent instance that you can populate with the relevant data.

    Declaration
    public TransactionEvent()

    TransactionEvent(string)

    Creates a new TransactionEvent instance with a different schema name. For derived types such as TransactionFailed.

    Declaration
    protected TransactionEvent(string name)
    Parameters
    Type Name Description
    string name

    The name of the schema to which this event conforms.

    Properties

    PaymentCountry

    (Optional) The country where this transaction is taking place.

    Declaration
    public string PaymentCountry { set; }
    Property Value
    Type Description
    string

    ProductId

    (Optional) The product identifier (known as a SKU) found in the store.

    Declaration
    public string ProductId { set; }
    Property Value
    Type Description
    string

    ReceivedItems

    (Optional) The items received from this transaction.

    Declaration
    public List<TransactionItem> ReceivedItems { get; }
    Property Value
    Type Description
    List<TransactionItem>

    ReceivedRealCurrency

    (Optional) The real currency received from this transaction.

    Declaration
    public TransactionRealCurrency ReceivedRealCurrency { get; set; }
    Property Value
    Type Description
    TransactionRealCurrency

    ReceivedVirtualCurrencies

    (Optional) The virtual currencies received from this transaction.

    Declaration
    public List<TransactionVirtualCurrency> ReceivedVirtualCurrencies { get; }
    Property Value
    Type Description
    List<TransactionVirtualCurrency>

    SpentItems

    (Optional) The items spent in this transaction.

    Declaration
    public List<TransactionItem> SpentItems { get; }
    Property Value
    Type Description
    List<TransactionItem>

    SpentRealCurrency

    (Optional) The real currency spent in this transaction.

    Declaration
    public TransactionRealCurrency SpentRealCurrency { get; set; }
    Property Value
    Type Description
    TransactionRealCurrency

    SpentVirtualCurrencies

    (Optional) The virtual currencies spent in this transaction.

    Declaration
    public List<TransactionVirtualCurrency> SpentVirtualCurrencies { get; }
    Property Value
    Type Description
    List<TransactionVirtualCurrency>

    StoreId

    (Optional) The store where the transaction is taking place.

    Declaration
    public string StoreId { set; }
    Property Value
    Type Description
    string

    StoreItemId

    (Optional) A unique identifier for the purchased item.

    Declaration
    public string StoreItemId { set; }
    Property Value
    Type Description
    string

    StoreItemSkuId

    (Optional) A unique identifier for the SKU, linked to the store SKU identifier.

    Declaration
    public string StoreItemSkuId { set; }
    Property Value
    Type Description
    string

    StoreSourceId

    (Optional) Identifies the source of the transaction, e.g. "3rd party".

    Declaration
    public string StoreSourceId { set; }
    Property Value
    Type Description
    string

    TransactionId

    (Optional) A unique identifier for this specific transaction.

    Declaration
    public string TransactionId { set; }
    Property Value
    Type Description
    string

    TransactionName

    (Required) A name that describes the transaction, for example "BUY GEMS" or "BUY ITEMS".

    Declaration
    public string TransactionName { set; }
    Property Value
    Type Description
    string

    TransactionReceipt

    (Optional) Transaction receipt data as provided by the store, to be used for validation.

    Declaration
    public string TransactionReceipt { set; }
    Property Value
    Type Description
    string

    TransactionReceiptSignature

    (Optional) The receipt signature from a Google Play purchase, to be used by the Google Play transaction validation process.

    Declaration
    public string TransactionReceiptSignature { set; }
    Property Value
    Type Description
    string

    TransactionServer

    (Optional) The server to use for receipt verification, if applicable.

    Declaration
    public TransactionServer TransactionServer { set; }
    Property Value
    Type Description
    TransactionServer

    TransactionType

    (Required) The type of the transaction.

    Declaration
    public TransactionType TransactionType { set; }
    Property Value
    Type Description
    TransactionType

    TransactorID

    (Optional) An identifier for the person or entity with whom the transaction the occuring. For example, if this is a trade, this would be the other player's unique identifier.

    Declaration
    public string TransactorID { set; }
    Property Value
    Type Description
    string

    Methods

    Reset()

    The Reset method is called after serialization is complete to empty it of data and allow the instance to be reused. This can reduce memory allocations and garbage collection.

    Declaration
    public override void Reset()
    Overrides
    Event.Reset()

    Validate()

    The Validate method is called internally during serialization to ensure that all required parameters have been set. If any required parameters are missing, warnings are recorded to the console.

    Declaration
    public override void Validate()
    Overrides
    Event.Validate()
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)