Overview
The NB Pixel is similar to pixels from other Ad Platforms like Facebook, Tiktok, Google Analytics, etc. It helps Newsbreak Ad Platform to track the conversion event that happened on the advertiser’s website and enables us to optimize the performance of your Ad campaign based on that.
Integration
There are only two steps you need to take to add the pixel:
1. Add your NewsBreak Pixel base code to Shopify
Get your NewsBreak Pixel base code
Log into NewsBreak Ad Manager and go to Tools > Event Tracking. The code in Step 1 is your base code. It looks like the snippet below (please note that instead of 'ID-1234567890123456789', you should use your unique ID in NewsBreak Event Tracking Tool). Copy that code.
<!-- Start NB Pixel Snippet -->
<script>
!(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', 'ID-1234567890123456789'),
nbpix('event', 'pageload');
</script>
<!-- End NB Pixel Snippet -->
Where to paste the base code?
It shall be pasted inside the<head> </head>
tags within your theme.liquid file of your Shopify store.
How to find the file and install NewsBreak pixel on Shopify?
-
From your Shopify admin, go to Online Store > Themes.
-
Find the theme you currently have active, then click Actions and select Edit code.
-
You shall see theme.liquid under Layout section, select to edit this file.
-
Paste the base code in the line before
</head>
and click Save to add tag.
Currently with NewsBreak you can track one conversion event. If your conversion event is the loading of your landing page, then the NewsBreak pixel is installed and you can follow the step 3 on NewsBreak Event Tracking Tool to test your pixel integration.
If your conversion event is not just customers landing on your page, but other specific events like add to cart or purchase, you’ll also add conversion tracking code. Depending on where the conversion event happens, you may need to choose one of the following options accordingly.
2. If your conversion event is Purchase
-
Find your NewsBreak Pixel base code in NewsBreak Event Tracking Tool, and replace
nbpix('event','pageload');
withnbpix('event','conversion_event');
just above the </script> tag.Now you get your conversion tracking code for purchase event, it looks something like snippet below (please note that instead of 'ID-1234567890123456789', you should use your unique ID in NewsBreak Event Tracking Tool).
<!-- Start NB Pixel Snippet -->
<script>
!(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', 'ID-1234567890123456789'),
nbpix('event', 'conversion_event');
</script>
<!-- End NB Pixel Snippet --> -
From your Shopify admin, go to Settings > Checkout and accounts.
-
Scroll down to the Order status page section, you’ll see a text box under Additional scripts like this:
-
Paste your conversion tracking code from step 1 into this box and save your settings.
Now you’re ready to go to Newsbreak Ad Manager to test your pixel integration, or let our AM/OPs know the integration is done and they can test it for you.
You can learn more about the setup in Add conversion tracking to your order status page