Skip to main content
Version: SDK 5.0.x

Class JtPurchaseEvent

Event that tracks and reports in-app purchase related details e.g user selected some item from store, confirmed purchase, added to cart. In case of a successful purchase or subscription justtrack automatically tracks and reports the event so there is no need to generate that event.

Hierarchy

AppEvent
+ JtPurchaseEvent

Constructors

Constructor

new JtPurchaseEvent(  
    jt_action: string,
    jt_product_id: string,
    jt_token?: undefined | string,
    jt_product_type: string,
    count?: null | number,
): JtPurchaseEvent

Parameters

NameTypeDescription
jt_actionstring-
jt_product_idstring-
jt_tokenundefined | string = undefined-
jt_product_typestring-
countnull | number = null-

Returns

JtPurchaseEvent

Overrides AppEvent.constructor

Methods

addDimension

addDimension(key: string, value?: undefined | string): AppEvent

Add a dimension with the given name and value.

Parameters

NameTypeDescription
keystringA unique name to be added to dimension's map
valueundefined | string = undefinedA value that associate to the given name.

Returns

AppEvent

The modified app event for chaining.

getDimensions

getDimensions(): Record<string, string>

Get the dimension of the event.

Returns

Record<string, string>

The dimension of the event.

getName

getName(): string

Get the name of the event.

Returns

string

The name of the event.

getValue

getValue(): null | Value | Money

Get the Value or Money of the event.

Returns

null | Value | Money

The Value of Money of the event.

removeDimension

removeDimension(key: string): AppEvent

Remove a dimension with the given name form an event again.

Parameters

NameTypeDescription
keystringThe name of the dimension to be removed again.

Returns

AppEvent

The modified app event for chaining.

setValue

setValue(value: null | Value | Money): AppEvent

Set the Value or Money of the event to the given values. There can only be either Value or Money assigns to the event.

Parameters

NameTypeDescription
valuenull | Value | MoneyThe new Value or Money of the event.

Returns

AppEvent

The modified app event for chaining.