<script
type="text/javascript"
src="//dynamic.criteo.com/js/ld/ld.js?a=YOUR_PARTNER_ID"
async="true"
></script>
<script type="text/javascript">
window.criteo_q = window.criteo_q || [];
var deviceType = /iPad/.test(navigator.userAgent)
? "t"
: /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(
navigator.userAgent
)
? "m"
: "d";
window.criteo_q.push(
{ event: "setAccount", account: "YOUR_PARTNER_ID" },
{ event: "setEmail", email: "", hash_method: "sha256" },
{ event: "setZipcode", zipcode: "" },
{ event: "setSiteType", type: deviceType },
{ event: "viewHome" }
);
</script>
<script type="text/javascript">
try {
if (sb?.product) {
window.criteo_q = window.criteo_q || [];
var deviceType = /iPad/.test(navigator.userAgent)
? "t"
: /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(
navigator.userAgent
)
? "m"
: "d";
window.criteo_q.push(
{ event: "setAccount", account: "YOUR_PARTNER_ID" }, // P값을 넣어주세요
{ event: "setEmail", email: "", hash_method: "sha256" },
{ event: "setZipcode", zipcode: "" },
{ event: "setSiteType", type: deviceType },
{ event: "viewItem", item: sb.product.baseInfo.productName }
);
}
} catch (error) {
console.error("Criteo Script has occurred: ", error);
}
</script>
<script type="text/javascript">
try {
const crItems = [];
const {
deliveryGroups = [],
price: { buyAmt = 0 },
} = sb.cart;
if (deliveryGroups.length > 0) {
deliveryGroups.map(({ orderProducts }) => {
orderProducts.map((product) => {
const { orderProductOptions } = product;
orderProductOptions.map((option) => {
const { productNo } = option;
const price = option.price.salePrice
? option.price.salePrice
: option.price.buyAmt;
crItems.push({
id: String(productNo),
price: price,
quantity: option["orderCnt"],
});
});
});
});
window.criteo_q = window.criteo_q || [];
var deviceType = /iPad/.test(navigator.userAgent)
? "t"
: /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(
navigator.userAgent
)
? "m"
: "d";
window.criteo_q.push(
{ event: "setAccount", account: "YOUR_PARTNER_ID" },
{ event: "setEmail", email: "", hash_method: "sha256" },
{ event: "setZipcode", zipcode: "" },
{ event: "setSiteType", type: deviceType },
{
event: "addToCart",
item: crItems,
}
);
}
} catch (error) {
console.error("Criteo Script has occurred: ", error);
}
</script>
<script type="text/javascript">
try {
if (sb.order) {
const {
orderNo,
payInfo: { payAmt },
orderOptionsGroupByPartner,
} = sb.order;
const criteoOrderItems = orderOptionsGroupByPartner.flatMap(
({ orderOptionsGroupByDelivery }) =>
orderOptionsGroupByDelivery.flatMap(({ orderOptions }) =>
orderOptions.map((options) => {
const {
productNo: id,
price: { immediateDiscountAmt: discount, buyPrice: price },
orderCnt: quantity,
} = options;
return {
id: String(id),
price,
quantity,
};
})
)
);
window.criteo_q = window.criteo_q || [];
var deviceType = /iPad/.test(navigator.userAgent)
? "t"
: /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(
navigator.userAgent
)
? "m"
: "d";
window.criteo_q.push(
{ event: "setAccount", account: "YOUR_PARTNER_ID" },
{ event: "setEmail", email: "", hash_method: "sha256" },
{ event: "setZipcode", zipcode: "" },
{ event: "setSiteType", type: deviceType },
{
event: "trackTransaction",
id: orderNo,
item: criteoOrderItems,
}
);
}
} catch (error) {
console.error("Criteo Script has occurred: ", error);
}
</script>