Skip to content

Instantly share code, notes, and snippets.

@jacobsander
Created June 29, 2021 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacobsander/9ae6c419a63fd44eea7ae5b694a3d533 to your computer and use it in GitHub Desktop.
Save jacobsander/9ae6c419a63fd44eea7ae5b694a3d533 to your computer and use it in GitHub Desktop.

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