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> EventLoggedFires 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
| Property | Type | Description |
|---|---|---|
Product | Product | Product details (see below) |
PurchaseSessionId | string | Unique identifier for the purchase session |
TransactionId | string | Platform-specific transaction identifier |
TransactionReceipt | string | Raw receipt or proof-of-purchase payload |
TransactionSignature | string | Optional signature for receipt verification |
OrderId | string | Order identifier associated with the transaction |
TransactionTimestamp | DateTime | Client-side timestamp of the purchase |
PurchaseProvider | string | Provider name: "apple", "google", or "xsolla" |
EconomyChangeId | string | Economy change identifier (optional, defaults to empty) |
Product class
TactileModules.Analytics.Product
| Property | Type | Description |
|---|---|---|
ID | string | Store product identifier (e.g. "com.game.iap.coins") |
Title | string | Human-readable product name |
Price | int | Price in minor currency units (e.g. $0.99 → 99) |
LocalCurrencyCode | string | ISO 4217 currency code for the localized price |
LocalPrice | double | Localized price as reported by the store |