Skip to content

PlayOpsAnalytics

The analytics service. Access via sdk.Analytics().

Methods

LogEvent(object eventObject)

Logs an analytics event. eventObject must be an instance of a class decorated with [TactileAnalytics.EventAttribute].

sdk.Analytics().LogEvent(new LevelCompleteEvent("level_01"));

LogPurchase(Transaction transaction)

Logs an in-app purchase for server-side receipt validation and revenue attribution. Both Transaction and Product live in the TactileModules.Analytics namespace.

using TactileModules.Analytics;
var product = new Product("com.mygame.coins_500", "500 Coins", 499, "USD", 4.99);
sdk.Analytics().LogPurchase(new Transaction(
purchaseSessionId: sessionId,
product: product,
transactionId: transactionId,
transactionReceipt: receiptString,
orderId: orderId,
transactionSignature: signature,
transactionTimestamp: DateTime.UtcNow,
purchaseProvider: "apple"
));

Register(IStatefulParameter statefulParameter)

Registers a stateful parameter that is automatically appended to every subsequent event.

sdk.Analytics().Register(new CurrentLevelParameter());

Events

EventLogged

event Action<Event> EventLogged

Fires after each event is queued. Useful for debugging or forwarding events to a secondary analytics system.

sdk.Analytics().EventLogged += (evt) => Debug.Log($"[Analytics] {evt.Name}");

IStatefulParameter interface

public interface IStatefulParameter
{
string Key { get; }
object Value { get; }
}

Implement this interface to create a parameter that is evaluated and appended to every event at flush time.

Transaction class

TactileModules.Analytics.Transaction

PropertyTypeDescription
ProductProductProduct details (see below)
PurchaseSessionIdstringUnique identifier for the purchase session
TransactionIdstringPlatform-specific transaction identifier
TransactionReceiptstringRaw receipt or proof-of-purchase payload
TransactionSignaturestringOptional signature for receipt verification
OrderIdstringOrder identifier associated with the transaction
TransactionTimestampDateTimeClient-side timestamp of the purchase
PurchaseProviderstringProvider name: "apple", "google", or "xsolla"
EconomyChangeIdstringEconomy change identifier (optional, defaults to empty)

Product class

TactileModules.Analytics.Product

PropertyTypeDescription
IDstringStore product identifier (e.g. "com.game.iap.coins")
TitlestringHuman-readable product name
PriceintPrice in minor currency units (e.g. $0.99 → 99)
LocalCurrencyCodestringISO 4217 currency code for the localized price
LocalPricedoubleLocalized price as reported by the store