Shopify
第 1 步:创建优惠
https://shopurl.com/?<YOUR-CLICK-ID-PARAMETER>={tid}步骤 2:代码放置

自定义结账选项
Shiprocket
GoKwik
收集数据
调试模式

最后更新于
https://shopurl.com/?<YOUR-CLICK-ID-PARAMETER>={tid}


最后更新于
analytics.subscribe("page_viewed", (event) => {
const sdkScript = document.createElement('script');
sdkScript.setAttribute('src', 'https://web-resources.offer18.net/sdk/web/WebSDK.js');
sdkScript.setAttribute('async', '');
document.head.appendChild(sdkScript);
sdkScript.onload = function () {
// window.Offer18WebSDK.activateDebugMode();
window.Offer18WebSDK.initializeConversion('<YOUR-CLICK-ID-PARAMETER>');
};
sdkScript.onerror = function () {
console.error('Failed to load the Offer18 Web SDK.');
};
});
analytics.subscribe('checkout_completed', (event) => {
var discountString;
var totalAmount = event.data.checkout.totalPrice.amount;
var orderID = event.data.checkout.order.id;
var currency = event.data.checkout.currencyCode;
var allDiscountCodes = event.data.checkout.discountApplications.map((discount) => { if (discount.type === 'DISCOUNT_CODE') { return discount; } });
if (allDiscountCodes.length > 10) { discountString = ''; } else { discountString = allDiscountCodes.map((item) => item.title).join(','); }
const sdkScript = document.createElement('script');
sdkScript.setAttribute('src', 'https://web-resources.offer18.net/sdk/web/WebSDK.js');
sdkScript.setAttribute('async', '');
document.head.appendChild(sdkScript);
sdkScript.onload = function () {
// window.Offer18WebSDK.activateDebugMode();
window.Offer18WebSDK.trackConversion({
domain: '<YOUR-POSTBACK-DOMAIN>',
accountId: '<YOUR-ACCOUNT-ID>',
offerId: '<CAMPAIGN-ID>',
postbackType: 'ajax',
coupon: `${discountString}`,
conversionData: {
sale: `${totalAmount}`,
currency: `${currency}`,
adv_sub5: `${orderID}`,
}
});
};
sdkScript.onerror = function () {
console.error('Failed to load the Offer18 Web SDK.');
};
});analytics.subscribe("page_viewed", (event) => {
const sdkScript = document.createElement('script');
sdkScript.setAttribute('src', 'https://web-resources.offer18.net/sdk/web/WebSDK.js');
sdkScript.setAttribute('async', '');
document.head.appendChild(sdkScript);
sdkScript.onload = function () {
// window.Offer18WebSDK.activateDebugMode();
window.Offer18WebSDK.initializeConversion('<YOUR-CLICK-ID-PARAMETER>');
};
sdkScript.onerror = function () {
console.error('Failed to load the Offer18 Web SDK.');
};
});
analytics.subscribe('PurchaseSR', (event) => {
var totalAmount = event.customData.value;
var orderID = event.customData.transaction_id;
const sdkScript = document.createElement('script');
sdkScript.setAttribute('src', 'https://web-resources.offer18.net/sdk/web/WebSDK.js');
sdkScript.setAttribute('async', '');
document.head.appendChild(sdkScript);
sdkScript.onload = function () {
// window.Offer18WebSDK.activateDebugMode();
window.Offer18WebSDK.trackConversion({
domain: '<YOUR-POSTBACK-DOMAIN>',
accountId: '<YOUR-ACCOUNT-ID>',
offerId: '<CAMPAIGN-ID>',
postbackType: 'ajax',
coupon: `${discountString}`,
conversionData: {
sale: `${totalAmount}`,
adv_sub5: `${orderID}`,
}
});
};
sdkScript.onerror = function () {
console.error('Failed to load the Offer18 Web SDK.');
};
});analytics.subscribe("page_viewed", (event) => {
const sdkScript = document.createElement('script');
sdkScript.setAttribute('src', 'https://web-resources.offer18.net/sdk/web/WebSDK.js');
sdkScript.setAttribute('async', '');
document.head.appendChild(sdkScript);
sdkScript.onload = function () {
// window.Offer18WebSDK.activateDebugMode();
window.Offer18WebSDK.initializeConversion('<YOUR-CLICK-ID-PARAMETER>');
};
sdkScript.onerror = function () {
console.error('Failed to load the Offer18 Web SDK.');
};
});
analytics.subscribe('gokwik', (event) => {
var totalAmount = eventData.customData.total_price;
var orderID = eventData.customData.order_name;
const sdkScript = document.createElement('script');
sdkScript.setAttribute('src', 'https://web-resources.offer18.net/sdk/web/WebSDK.js');
sdkScript.setAttribute('async', '');
document.head.appendChild(sdkScript);
sdkScript.onload = function () {
// window.Offer18WebSDK.activateDebugMode();
window.Offer18WebSDK.trackConversion({
domain: '<YOUR-POSTBACK-DOMAIN>',
accountId: '<YOUR-ACCOUNT-ID>',
offerId: '<CAMPAIGN-ID>',
postbackType: 'ajax',
coupon: `${discountString}`,
conversionData: {
sale: `${totalAmount}`,
adv_sub5: `${orderID}`,
}
});
};
sdkScript.onerror = function () {
console.error('Failed to load the Offer18 Web SDK.');
};
});`${currency}``${totalAmount}``${orderID}``${discountString}`