Skip to content

Instantly share code, notes, and snippets.

@mininaim
Created May 15, 2024 09:19
Show Gist options
  • Save mininaim/534a1462be4d6e3796c7c9601eae20aa to your computer and use it in GitHub Desktop.
Save mininaim/534a1462be4d6e3796c7c9601eae20aa to your computer and use it in GitHub Desktop.
<script>
window.purchaseEvent = function purchaseEvent(transactionItems) {
campaign(6, 'purchase', transactionItems);
}
window.productDetailsEvent = function productDetailsEvent(productViewd) {
window.setTimeout(function() {
productDetailsInfo(productViewd);
}, 5000);
let BoostcheckInterval = setInterval(function() {
if (document.readyState == 'complete') {
BoostApp_event('ProductView', productViewd);
clearInterval(BoostcheckInterval);
}
}, 1000);
let checkInterval = setInterval(function() {
if (document.readyState == 'complete') {
window.campaign(5, 'product-view', productViewd);
clearInterval(checkInterval);
}
}, 1000);
}
window.addToCartEvent = function addToCartEvent(productCart) {
window.setTimeout(function() {
sendAddToCartInfo(productCart);
}, 5000);
BoostApp_event('AddToCart', productCart);
campaign(2, 'add-remove-cart', productCart);
}
window.removeFromCartEvent = function removeFromCartEvent(productCart) {
BoostApp_event('RemoveCartProduct', productCart);
campaign(3, 'add-remove-cart', productCart);
}
window.startCheckoutEvent = function startCheckoutEvent(cart) {
window.setTimeout(function() {
sendStartCheckoutInfo(cart);
}, 5000);
alert("start checkout");
}
window.enableServerConversionEvents = true;
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment