Skip to content

Instantly share code, notes, and snippets.

@kmclaugh
Last active January 18, 2022 17:35
Show Gist options
  • Save kmclaugh/c94b87357607826ceba9a447506cec61 to your computer and use it in GitHub Desktop.
Save kmclaugh/c94b87357607826ceba9a447506cec61 to your computer and use it in GitHub Desktop.
How to update the products array.
/*
* description: You need to update the products array to change the id field
* from the product id to the product sku so it matches the checkout experience.
* See the example product detail event below.
*/
{
event: "view_item_ua",
ecommerce: {
detail: {
products: [
{
price: "70.0",
quantity: 1,
name: "Black Clay - Large Serving Bowl",
id: "DEC-KIT-BWL-SER-MEX-LRG-BLK-001", // <- Needs to be the sku not product id (1298962841707)
brand: "Mexico",
category: "Tabletop",
variant: "Default"
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment