1.创建Pixel事件 得到事件ID



2.安装模板基础代码

模板基础代码(切记替换ID)
<script type="text/javascript">
// =========================//
// Newsbreak v1.3
// ***************************//
const NB_ID = 'ID-XXXXXXXXXXXXXXXXXXX';
// ===================
// DO NOT UPDATE BELOW
// ===================
!(function (e, n, t, i, p, a, s) {
e[i] ||
(((p = e[i] =
function () {
p.process ? p.process.apply(p, argument) : p.queue.push(arguments);
}).queue = []),
(pt = +new Date()),
((a = n.createElement(t)).async = 1),
(a.src = 'https://static.newsbreak.com/business/tracking/nbpixel.js?t=' + 864e5 * Math.ceil(new Date() / 864e5)),
(s = n.getElementsByTagName(t)[0]).parentNode.insertBefore(a, s));
})(window, document, 'script', 'nbpix'),
nbpix("init", NB_ID.trim()),
nbpix('event', 'pageload');
(async () => {
//save cid params to localstorage
var url = new URL(window.location.href);
var c_id = url.searchParams.get('newsbreak_cid');
if (c_id) {
localStorage.setItem('_newsbreak_click_id', c_id);
}
})()
// =========================//
// Newsbreak end
// ***************************//
</script>
3.创建shopify客户事件


shopify 客户事件代码(复制后切记修改ID)
// =========================//
// Newsbreak v1.3
// ***************************//
const NB_ID = 'ID-XXXXXXXXXXXXXXXXXXX';
// ===================
// DO NOT UPDATE BELOW
// ===================
!(function (e, n, t, i, p, a, s) {
e[i] ||
(((p = e[i] =
function () {
p.process ? p.process.apply(p, arguments) : p.queue.push(arguments);
}).queue = []),
(p.t = +new Date()),
((a = n.createElement(t)).async = 1),
(a.src = 'https://static.newsbreak.com/business/tracking/nbpixel.js?t=' + 864e5 * Math.ceil(new Date() / 864e5)),
(s = n.getElementsByTagName(t)[0]).parentNode.insertBefore(a, s));
})(window, document, 'script', 'nbpix'),
nbpix('init', NB_ID.trim()),
analytics.subscribe("checkout_completed", event => {
nbpix('event', 'complete_payment', {nb_value: event.data.checkout.totalPrice.amount});
});
analytics.subscribe("payment_info_submitted", event => {
nbpix('event', 'add_payment_info', {nb_value: event.data.checkout.totalPrice.amount});
});
analytics.subscribe("product_added_to_cart", event => {
nbpix('event', 'add_to_cart', {nb_value: event.data.cartLine.cost.totalAmount.amount});
});
analytics.subscribe("checkout_started", event => {
nbpix('event', 'initiate_checkout', {nb_value: event.data.checkout.totalPrice.amount});
});
analytics.subscribe("product_viewed", event => {
nbpix('event', 'view_content', {nb_value: event.data.productVariant.price.amount});
});
analytics.subscribe("search_submitted", event => {
nbpix('event', 'search');
});
// =========================//
// Newsbreak end
// ***************************//
3.把事件ID填入插件

4.走测试结账模式激活事件
发表回复