Track Purchase Event

This function logs a purchase event with the specified order ID, purchase amount, currency, and optional additional parameters. It is used to track purchase transactions within an application.

Method Signature:

+ (void)trackPurchaseEvent:(NSString *)orderId
            purchaseAmount:(float)purchaseAmount
                  currency:(NSString *)currency
              andWithParam:(NSDictionary *)extraParams;

Parameters:

  • orderId (NSString *): The unique identifier for the order. This parameter is optional and can be null.

  • purchaseAmount (float): The total amount of the purchase.

  • currency (NSString *): The currency of the purchase amount. This parameter is optional and can be null.

  • extraParams (NSDictionary *, optional): A dictionary containing key-value pairs of additional data to be logged with the purchase event.

Example Usage:

// Without additional parameters
[YourSDKClass trackPurchaseEvent:@"12345" purchaseAmount:99.99 currency:@"USD" andWithParam:nil];

// With additional parameters
NSDictionary *params = @{@"payment_method": @"credit_card", @"customer_type": @"new"};
[YourSDKClass trackPurchaseEvent:@"12345" purchaseAmount:99.99 currency:@"USD" andWithParam:params];

Last updated