Getting Started with Northbeam Pixel API

This page will help you get started with Northbeam Pixel API. You'll be up and running in a jiffy!

The Northbeam Pixel exposes an object in the global JavaScript namespace on your website. These functions help you do various tasks that aren't handled by the Northbeam Pixel's default configuration.

If you have a custom setup or are not on Shopify, at minimum you will need to implement the firePurchaseEvent method at every conversion point.

Northbeam pixel

You will need to install the Northbeam pixel on every page of your website before these functions will be exposed.

Success result

If there are no errors and the function returns undefined then the call was successful.

Orders sync API

All non-Shopify brands will need to implement our server-to-server API

Asynchronous loading

The Northbeam pixel is loaded asynchronously in a script tag. This means that the object provided by the pixel, window.Northbeam, may not be available right away. In some cases it will not be available at a time when you want to use a function provided by it, e.g. if you want to call window.Northbeam.firePurchaseEvent(args) as soon as your webpage loads. If you find yourself in this situation (i.e. you wishe to make a call to the window.Northbeam object before it is defined), you are able to define a function on the Window object that our pixel will call as soon as it is loaded. You should define your function under the window property window.onNorthbeamLoad, because that is where our pixel will look for your callback after it has loaded.

In less words:

Client: “Northbeam Pixel are you loaded? I want to call firePurchaseEvent”
Northbeam: “Nope, I don’t exist yet, but if you define a function in window.onNorthbeamLoad that calls Northbeam.firePurcaseEvent, I’ll call that function as soon as I’m loaded.”

See "recipes" for a code example!

Pro Tip If you define window.onNorthbeamLoad in a script that is physically above the script that loads the Northbeam pixel, it is guaranteed to be defined before window.Northbeam is defined.