Maestra
Track Wishlist events in Maestra.
Code Access
export function setup({ app }) {
// Leave the default subscribers and add the code below
app.events.subscribe("wk:wishlist:add:success", (event) => {
const { product, variant } = event.data;
mindbox?.("async", {
operation: "AddToWishList",
data: {
customer: {
email: app.customer?.email,
},
addProductToList: {
productGroup: {
ids: {
shopifyUK: product.id,
}
},
product: {
ids: {
shopifyUK: variant?.id,
}
}
}
}
});
});
app.events.subscribe("wk:wishlist:remove:success", (event) => {
const { product, variant } = event.data;
mindbox?.("async", {
operation: "RemoveFromWishList",
data: {
customer: {
email: app.customer?.email,
},
removeProductFromList: {
productGroup: {
ids: {
shopifyUK: product.id,
}
},
product: {
ids: {
shopifyUK: variant?.id,
}
}
}
}
});
});
}Last updated