These instructions provide an overview on how to setup Connexity's and Taboola's Unified Ecommerce Pixel using Shopify's platform integration.
The Taboola Ecommerce Events Pixel on your website drives scaled shopper targeting and optimization for your Connexity performance marketing campaign. Advertisers working with Taboola and Connexity use pixels to drive campaign success. Our Pixels gather data to help you understand the actions users take on your website, like page visits, account creation, purchases, and video views. These activity signals help us to optimize your marketing campaigns for maximum success. You can learn more about the pixel and how it impacts your campaigns here.
Add Unified Pixel Code to Customer Events
Add the Unified Pixel into Customer Events to track ecommerce behavior on your site. Navigate to your Shopify settings and select Customer Events. Click on Add Custom Pixel on the top right.
Next you will receive a prompt to name the custom pixel. Click Add pixel when complete.
Note: Use a naming convention that you can easily identify for future reference (e.g., CNX Unified Pixel)
In the next screen, add the pixel code into this section.
Note: Replace all fields in RED with your Advertiser ID supplied by your Connexity Account Manager. This is NOT the same as your Connexity Merchant ID (MID).
// Initializing Taboola base code
window._tfa = window._tfa || [];
window._tfa.push({notify: 'event', name: 'page_view', id:ADVERTISER_ID
});
!function (t, f, a, x) {
if (!document.getElementById(x)) {
t.async = 1;t.src = a;t.id=x;f.parentNode.insertBefore(t, f);
}
}(document.createElement('script'),
document.getElementsByTagName('script')[0],
'//cdn.taboola.com/libtrc/unip/ADVERTISER_ID/tfa.js',
'tb_tfa_script');
analytics.subscribe("product_viewed", event => {
window._tfa.push({id: ADVERTISER_ID,notify: 'ecevent', name: 'PRODUCT_VIEW',
productIds: [event.data?.productVariant?.product?.id]
});
});
analytics.subscribe("product_added_to_cart", event => {
window._tfa.push({ id: ADVERTISER_ID, notify: 'ecevent', name: 'ADD_TO_CART',
productIds: [event.data?.cartLine?.merchandise?.product?.id]
});
});
// Purchase Event
analytics.subscribe("checkout_completed", event => {
var cart=event.data?.checkout?.lineItems;
var cart_details=[];
// Making the Proper Cart Details array for the object
for (let i = 0; i < cart.length; i++) {
let cart_item= {
productId:cart[i].id,
quantity: cart[i].quantity,
price: cart[i].variant?.price?.amount
};
cart_details.push(cart_item);
}
window._tfa.push({id: ADVERTISER_ID, notify: 'ecevent', name: 'PURCHASE',
orderId: event.data?.checkout?.order?.id,
currency: event.data?.checkout?.currencyCode,
value: event.data?.checkout?.subtotalPrice?.amount,
cartDetails: cart_details
});
});
Make sure that the event.data?.productVariant?.product?.id reported by these Shopify events match within your internal product feed for proper identification.
Once the code has been added, click the Save button on the top navigation bar.
Test and Verify
Once you have implemented the Unified Commerce Pixel on your Shopify store, we recommend that you verify your implementation.
To verify that the Unified Commerce Pixel is present and working, please choose one of the verification methods provided here in our Unified Pixel documentation.
Once you have verified your pixel is installed properly and working, please follow up with your Account Manager to confirm implementation.