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.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()

    Declaration
    public TransactionEvent()

    TransactionEvent(string)

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

    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()

    Clears all parameters and values so that the instance can be reused.

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

    Validate()

    Note that failing validation will not prevent event serialisation or upload. This method is intended to produce warning logs to assist in implementation and debugging. Events will still be validated properly by the server on reaching it.

    Declaration
    public override void Validate()
    Overrides
    Event.Validate()
    In This Article
    Back to top
    Copyright © 2025 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)