PurchaseEvent

public struct PurchaseEvent

Represents a purchase event for tracking and segmentation.

  • The amount of the purchase.

    Declaration

    Swift

    public let amount: Double
  • The currency of the purchase (ISO 4217 code, e.g., “USD”).

    Declaration

    Swift

    public let currency: String
  • sku

    (Optional) The Stock Keeping Unit identifier. Used for tracking and segmentation.

    Declaration

    Swift

    public let sku: String?
  • (Optional) The display name of the product. Used for tracking only.

    Declaration

    Swift

    public let name: String?
  • Creates a new PurchaseEvent instance.

    Declaration

    Swift

    public init(amount: Double, currency: String, sku: String?, name: String? = nil)

    Parameters

    amount

    The amount of the purchase.

    currency

    The currency of the purchase (ISO 4217 code, e.g., “USD”).

    sku

    (Optional) The Stock Keeping Unit identifier. Used for tracking and segmentation.

    name

    (Optional) The display name of the product. Used for tracking only.