Implementing the Full Barion Pixel: Difference between revisions

From Barion Documentation
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{PageTitle|title= Implementing the Full Barion Pixel}} = Prerequisites = Implementing the Full Barion Pixel first and foremost requires an implementation of the Ba...")
 
No edit summary
Line 30: Line 30:
             'variant': 'hardcover'
             'variant': 'hardcover'
         }
         }
|}
This can simply be inserted into your page JS code, so that it executes on every page load. This means that if you have a simple HTML page, you can insert this into a script tag, or if you use a template system, you can create a template from this code. GTM users can also put this in a tag that fires every page load, hovewer getting the actual parameters is beyond the scope of this guide as it varies from webshop to webshop. The best place to start might be to check if it is available in a Google Analytics data layer, or you can just grab it from the HTML directly with JS selectors.
After creating this object, the event must be fired by calling the "bp" function in the way shown below. The first parameter tells the Pixel that this is an user fired event, the second parameter is the event name, while the last parameter passed should be the object that you just created.
{| role="presentation" class="wikitable"
| <strong> Firing the Content View event </strong>
|-
|
        bp('track', 'contentView', contentViewProperties);
|}
|}

Revision as of 11:05, 6 February 2020

Implementing the Full Barion Pixel

Prerequisites

Implementing the Full Barion Pixel first and foremost requires an implementation of the Base Barion Pixel on your webshop. It is not necessary that the Base implementation be accepted by Barion however before the start of the implementation, just be aware that only approved events will be sent towards Barion. As the Full Barion Pixel, with the Consent Management implementation in particular, requires that you send user data for marketing purposes towards us, it requires a separate agreement and approval from Barion.

Where to start?

The preferred starting point for implementing the Full Barion Pixel is the Content View event, for cases where the content type is 'Product' in particular. This event is a very often used one, since it should be implemented in every product page at least. This event is also easy to implement, since it should be triggered every page load.

The first step is to create a JS object that contains the event parameters, as detailed in the API reference. See below for an example.

This can simply be inserted into your page JS code, so that it executes on every page load. This means that if you have a simple HTML page, you can insert this into a script tag, or if you use a template system, you can create a template from this code. GTM users can also put this in a tag that fires every page load, hovewer getting the actual parameters is beyond the scope of this guide as it varies from webshop to webshop. The best place to start might be to check if it is available in a Google Analytics data layer, or you can just grab it from the HTML directly with JS selectors.

After creating this object, the event must be fired by calling the "bp" function in the way shown below. The first parameter tells the Pixel that this is an user fired event, the second parameter is the event name, while the last parameter passed should be the object that you just created.