Skip to content

Instantly share code, notes, and snippets.

@jacobsander
Created Jun 29, 2021
Embed
What would you like to do?

Syntax

contextData["&&products"] = "Category;Product;Quantity;Price[,Category;Product;Quantity;Price]"

Example

//create a context data dictionary
var contextData:[String:String]=[:] 

// add products, a purchase id, a purchase context data key, and any other data you want to collect.
// Note the special syntax for products
contextData["&&products"] = "Men;Shirt;1;500"
contextData["m.purchaseid"] = "1234567890"
contextData["m.purchase"] = "1"
contextData["&&currencyCode"] = "DKK"

// send the tracking call - use either a trackAction or TrackState call.
// trackAction example:
ACPCore.trackAction("purchase", data: contextData)
// trackState example:
ACPCore.trackState("Order Confirmation", data: contextData)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment