What is the NewsBreak Pixel?
The NewsBreak Pixel is a tracking tool that functions similarly to those used by platforms like Facebook, TikTok, and Google Analytics. It helps the NewsBreak Ad Manager monitor user actions on your website, enabling better optimization of your ad campaigns based on real user behavior.
________________________________________________________________________________________
How Does It Work?
The pixel uses a small JavaScript snippet embedded on your website. This snippet collects data from specific conversion events and sends it back to NewsBreak for reporting and optimization.
________________________________________________________________________________________
How to Install the NewsBreak Pixel
Step 1: Locate Your Pixel Base Code
1. Log into Ad Manager and navigate to Tools > Event Management to create a web event.
2. Choose the following settings:
-
-
Tracking Type: Pixel
-
Integration Method: Custom Code
-
Event Type: Select the appropriate event
- (Optional) Enable Event Value if your event includes a monetary value.
-
Tracking Type: Pixel
3. After completing all required fields, your base pixel code will be generated.
4. Copy the base pixel code provided in Step 1 from the Event Management page.
✍️Note: Replace 'ID-1234567890' below with your unique ID found in the Event Management section.
The base code should look like this:
<!-- 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-1234567890'),
nbpix('event', 'pageload');
</script>
<!-- End NB Pixel Snippet -->
Step 2: Embed the Base Code in Your Website
Paste the copied base code just before the </head> tag on your website’s HTML/System
✍️Note: Please make sure the code is placed within the <head> tags for it to function correctly.
Tracking Custom Conversion Events
If you need to track specific actions beyond page loads (such as purchases or adding items to a cart), you’ll need to add additional event code.
Example: Tracking a “Purchase” Event
To track a completed purchase, add the following snippet to the relevant page or event handler:
<!-- Track conversion event — use EXACTLY complete_payment -->
<script>
nbpix('event', complete_payment);
</script>
Add this snippet:
- In the section of your website that handles purchases, or
- On the confirmation/thank-you page that follows a completed order.
After Integration: What’s Next?
Once your pixel is installed, test it using Ad Manager’s built-in tools (see below).
Step 3: Test Your Integration
Return to Ad Manager and go to Step 3 in the Event Management section to test your pixel integration. You should eventually see: 'Test successful' and be able to save your event for the final step.