Class: Analytics

Analytics

Methods

(static) trackCustomEvents(customEvent) → {Promise.<errorResponse>}

Track custom events
Parameters:
Name Type Description
customEvent Array.<event> Array of custom events.
Source:
Returns:
- A Promise with an error response.
Type
Promise.<errorResponse>

(static) trackPurchaseEvents(purchaseEvent) → {Promise.<errorResponse>}

Track purchase events
Parameters:
Name Type Description
purchaseEvent Array.<event> Array of purchase events.
Source:
Returns:
- A Promise with an error response.
Type
Promise.<errorResponse>

Type Definitions

customEvent

Type:
  • Object
Properties:
Name Type Description
name string Event name.
custom_data Object.<string, string> The custom data from the event.
Source:

errorResponse

Type:
  • Object
Properties:
Name Type Description
error string Error type. Enum: "UnknownError" "BadRequest" "ResourceExists" "Unauthorized" "NotFound" "PartialSuccess"
message string Error description.
context Object.<string, string> Error context.
Source:

purchaseEvent

Type:
  • Object
Properties:
Name Type Description
custom_data Object.<string, string> The custom data from the event.
product_id string The SKU of the product.
product_type string The type of the product. Either "item" or "subscription"
product_title string The display name for the product.
price number The product price in the original currency.
price_currency string The purchase currency.
purchase_date string The datetime of the event in ISO 8601 format. Only needed if differs from the current date-time.
transaction_identifier string A unique transaction identifier.
Source: