Barion Pixel API reference: Difference between revisions

From Barion Documentation
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 295: Line 295:
         }
         }


        // Use one of these to add the event listener to the button click (use only one):


         // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
         bp('track', 'contentView', contentViewProperties);
        window.addEventListener('onload', function() {
            bp('track', 'contentView', contentViewProperties);
        });
 
        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("window").load(function() {
            bp('track', 'contentView', contentViewProperties);
        });


     </nowiki>
     </nowiki>
Line 1,062: Line 1,053:




== Category Selection (categorySelection) ==


== Click Product (clickProduct) ==
* Firing event: ''Button click'' on a category on a category selection page
* User intent: View a category
* Why do we need this: Users demonstrate interest in items belonging to a category by looking at the category


* Firing event: ''Button click'' on an item
This event should be implemented where the user can select a category of events on a page, for example a brand, a common
* User intent: View an item
property, a theme, a price range or any grouping of product along something that makes them belong to the category.
* Why do we need this: Users demonstrate interest in your items by clicking them
 
This event should be fired each time when a user selects any of your items. This could be for example on a product
selection page, a result on a search or filter page, an item on a promotion. The page type on which the button is on
should be specified in the 'list' property. In case of product bundles, you can use the 'contents' property to list each
item in the bundle, while the direct properties should refer to the bundle as a whole as an item.






'''Click product event properties'''
'''Category selection event properties'''


{| class="wikitable"
{| class="wikitable"
Line 1,083: Line 1,071:
! type
! type
! description
! description
|-
! contentType
| YES
| text
| The type of the content of the page where the item was selected. Possible values (only these are accepted): Page/Product/Article/Promotion/Banner/Misc.
|-
! currency
| YES
| text (ISO 4217)
| Currency that the item is listed in for purchase. 3 digit ISO 4217 format is preferred (eg. HUF, EUR).
|-
|-
! id
! id
| YES
| YES
| text
| text
| Unique ID of the item clicked on your site.
| Unique ID of the category clicked on your site.
|-
|-
! name
! name
| YES
| YES
| text
| text
| Full name of the item clicked.
| Full name of the category.
|-
|-
! quantity
! brand
| YES
| NO
| integer
| text
| The quantity of a product clicked measured in the unit provided (e.g. 2).
| Brand of the item in the category clicked.
|-
! unit
| YES
| text
| The measurement unit of the item clicked. (e.g. pcs, kg).
|-
! unitPrice
| YES
| float
| Price of one unit (that you provided) of the item clicked (in the currency that you provided).
|-
! brand
| NO
| text
| Brand of the item clicked.
|-
|-
! category
! category
| NO
| NO
| text
| text
| The category (eg. 'winter shoes' or 'summer shoes') or subcategory branch (eg. 'clothes|shoes|winter' or 'clothes|shoes|summer', separate levels with '|') of the item clicked.
| | The category (eg. 'winter shoes' or 'summer shoes') or subcategory branch (eg. 'clothes|shoes|winter' or 'clothes|shoes|summer', separate levels with '|') of the category that was clicked.
|-
|-
! contents
! contents
| NO
| NO
| array
| array
| An array of JS objects for detailing multiple items clicked. For more details see the table below.
| An array of JS objects for detailing items in the category. For more details see the table below.
|-
|-
! creative
! contentType
| NO
| NO
| text
| text
| The name or description of the promotion for the item, for example a promotion picture filename or slogan of the promotion that selects the item.
| Usually this value should be "Page".
|-
|-
! customerValue
! customerValue
Line 1,143: Line 1,106:
| float
| float
| The value of a user performing this event to the business.
| The value of a user performing this event to the business.
|-
! ean
| NO
| text
| Contains the International Article Number (EAN) of the item if available.
|-
|-
! list
! list
| NO
| NO
| text
| text
| The collection that the product clicked is in from one of these possible values: HomePage/SearchPage/ProductPage/Recommendation/ComparisonPage/BasketPage/Checkout/Misc
| The collection that the category clicked is in from one of these possible values: HomePage/SearchPage/ProductPage/Recommendation/ComparisonPage/BasketPage/Checkout/Misc
|-
|-
! position
! position
| NO
| NO
| text
| text
| The product's position in the list or collection (e.g. 2) or the position of the creative (e.g. banner_slot_1)
| The category's position in the list or collection (e.g. 2) or the position of the creative (e.g. banner_slot_1)
|-
|-
! step
! step
| NO
| NO
| integer
| integer
| A number that represents the progress in the checkout process. Usually at a click product event, this is 0.
| A number that represents the progress in the checkout process.
|-
|}
! variant
 
| NO
| text
| The variant of the product (e.g. 'black') clicked.
|}




 
'''Category selection event implementation example'''
'''Click product event implementation example'''


     <nowiki>
     <nowiki>


         // sample product data for single product
         // sample category data
         var clickProductProperties = {
         var categorySelectionProperties = {
            'contentType': 'Product',
             'id': 'books_scifi',
            'currency': 'HUF',
             'name': 'Sci-Fi Books',
             'id': 'item_42',
             'brand': undefined,
             'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
             'category': 'Books',
            'quantity': 1,
             'contents': undefined,
            'unit': 'pcs',
             'contentType': 'Page',
            'unitPrice': 2500.0,
             'customerValue': 150,
             'brand': 'Gollancz',
             'list': 'SearchPage',
             'category': 'books|hardcover|scifi, books|hardcover|comedy',
             'position': 42,
             'contents': []
             'step': undefined
             'creative': 'book_42',
             'customerValue': '150.0',
            'ean': 9780575115347,
             'list': 'Checkout',
             'position': 1,
             'step': 2,
            'variant': 'hardcover'
         }
         }


        // Use one of these to add the event listener to the button click (use only one):
        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('select_category').addEventListener('click', function() {
            bp('track', 'categorySelection', categorySelectionProperties);
        });


         // sample product data for bundle offer
         // jQuery (if you use jQuery, if in your console "$" is defined on your site)
         var clickProductProperties = {
         $("#select_category").click(function() {
             'contentType': 'Product',
             bp('track', 'categorySelection', categorySelectionProperties);
            'currency': 'HUF',
        });
            'id': 'item_42pack',
 
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
    </nowiki>
            'quantity': 1,
 
            'unit': 'pcs',
 
            'unitPrice': 15000.0,
 
            'brand': 'Gollancz',
== Click Product (clickProduct) ==
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
 
            'contents': [{
* Firing event: ''Button click'' on an item
                'contentType': 'Product',
* User intent: View an item
                'currency': 'HUF',
* Why do we need this: Users demonstrate interest in your items by clicking them
                'id': 'item_42',
 
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
This event should be fired each time when a user selects any of your items. This could be for example on a product
                'quantity': 3,
selection page, a result on a search or filter page, an item on a promotion. The page type on which the button is on
                'totalItemPrice': 7500.0,
should be specified in the 'list' property. In case of product bundles, you can use the 'contents' property to list each
                'unit': 'pcs',
item in the bundle, while the direct properties should refer to the bundle as a whole as an item.
                'unitPrice': 2500.0,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
                {
                'contentType': 'Product',
                'currency': 'USD',
                'id': 'item_42en',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 25.935,
                'unit': 'pcs',
                'unitPrice': 8.645,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
            ]
            'creative': 'bundle_offer_01',
            'customerValue': '150.0',
            'ean': 9780575115347,
            'list': 'Checkout',
            'position': 1,
            'step': 2,
            'variant': 'hardcover'
        }


        // Use one of these to add the event listener to the button click (use only one):


        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('book_42').addEventListener('click', function() {
            bp('track', 'clickProduct', clickProductProperties);
        });


        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("#book_42").click(function() {
            bp('track', 'clickProduct', clickProductProperties);
        });


    </nowiki>
'''Click product event properties'''
 
 
== Click Product Detail (clickProductDetail) ==
 
* Firing event: ''Button click'' requesting extended details about an item
* User intent: View extended information about an item
* Why do we need this: Users demonstrate high interest in your items by looking up details about them
 
This event should fire on a button click that can be either a webpage or an asynchronous request for more details about
an item. It should be implemented at any button that results in more details being shown about an item.
 
 
 
'''Click product detail event properties'''


{| class="wikitable"
{| class="wikitable"
Line 1,304: Line 1,200:
| text
| text
| Full name of the item clicked.
| Full name of the item clicked.
|-
! quantity
| YES
| integer
| The quantity of a product clicked measured in the unit provided (e.g. 2).
|-
|-
! unit
! unit
Line 1,315: Line 1,216:
| Price of one unit (that you provided) of the item clicked (in the currency that you provided).
| Price of one unit (that you provided) of the item clicked (in the currency that you provided).
|-
|-
! variant
! brand
| NO
| NO
| text
| text
| The variant of the product (e.g. 'black') clicked.
| Brand of the item clicked.
|-
! brand
| NO
| text
| Brand of the item clicked.
|-
|-
! category
! category
Line 1,364: Line 1,260:
| integer
| integer
| A number that represents the progress in the checkout process. Usually at a click product event, this is 0.
| A number that represents the progress in the checkout process. Usually at a click product event, this is 0.
|-
! quantity
| NO
| integer
| The quantity of a product clicked measured in the unit provided (e.g. 2).
|-
|-
! variant
! variant
Line 1,383: Line 1,274:


         // sample product data for single product
         // sample product data for single product
         var clickProductDetailProperties = {
         var clickProductProperties = {
             'contentType': 'Product',
             'contentType': 'Product',
             'currency': 'HUF',
             'currency': 'HUF',
             'id': 'item_42',
             'id': 'item_42',
             'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
             'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'quantity': 1,
             'unit': 'pcs',
             'unit': 'pcs',
             'unitPrice': 2500.0,
             'unitPrice': 2500.0,
             'brand': 'Gollancz',
             'brand': 'Gollancz',
             'category': 'books|hardcover|scifi, books|hardcover|comedy',
             'category': 'books|hardcover|scifi, books|hardcover|comedy',
             'contents': []
             'contents': undefined,
             'creative': 'book_42',
             'creative': 'book_42',
             'customerValue': '150.0',
             'customerValue': '150.0',
Line 1,399: Line 1,291:
             'position': 1,
             'position': 1,
             'step': 2,
             'step': 2,
            'quantity': 1,
             'variant': 'hardcover'
             'variant': 'hardcover'
         }
         }
Line 1,405: Line 1,296:


         // sample product data for bundle offer
         // sample product data for bundle offer
         var clickProductDetailProperties = {
         var clickProductProperties = {
             'contentType': 'Product',
             'contentType': 'Product',
             'currency': 'HUF',
             'currency': 'HUF',
             'id': 'item_42pack',
             'id': 'item_42pack',
             'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
             'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'quantity': 1,
             'unit': 'pcs',
             'unit': 'pcs',
             'unitPrice': 15000.0,
             'unitPrice': 15000.0,
Line 1,453: Line 1,345:
             'position': 1,
             'position': 1,
             'step': 2,
             'step': 2,
            'quantity': 1,
             'variant': 'hardcover'
             'variant': 'hardcover'
         }
         }
Line 1,460: Line 1,351:


         // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
         // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
         document.getElementById('more_details').addEventListener('click', function() {
         document.getElementById('book_42').addEventListener('click', function() {
             bp('track', 'clickProductDetail', clickProductDetailProperties);
             bp('track', 'clickProduct', clickProductProperties);
         });
         });


         // jQuery (if you use jQuery, if in your console "$" is defined on your site)
         // jQuery (if you use jQuery, if in your console "$" is defined on your site)
         $("#more_details").click(function() {
         $("#book_42").click(function() {
             bp('track', 'clickProductDetail', clickProductDetailProperties);
             bp('track', 'clickProduct', clickProductProperties);
         });
         });


Line 1,472: Line 1,363:




== Customize Product (customizeProduct) ==
== Click Product Detail (clickProductDetail) ==


* Firing event: ''Button click'' changing particular characteristics of an item
* Firing event: ''Button click'' requesting extended details about an item
* User intent: Change characteristics of an item
* User intent: View extended information about an item
* Why do we need this: Users demonstrate interest in your items by customizing them
* Why do we need this: Users demonstrate high interest in your items by looking up details about them


This event should fire on a button click that can be either a webpage or an asynchronous request for a different variant
This event should fire on a button click that can be either a webpage or an asynchronous request for more details about
of an item, for example color, size etc. It should be implemented at any button that results in a different variant
an item. It should be implemented at any button that results in more details being shown about an item.
being shown.






'''Customize product event properties'''
'''Click product detail event properties'''


{| class="wikitable"
{| class="wikitable"
Line 1,523: Line 1,413:
|-
|-
! variant
! variant
| YES
| NO
| text
| text
| The variant of the product (e.g. 'black') clicked.
| The variant of the product (e.g. 'black') clicked.
Line 1,566: Line 1,456:
| text
| text
| The product's position in the list or collection (e.g. 2) or the position of the creative (e.g. banner_slot_1)
| The product's position in the list or collection (e.g. 2) or the position of the creative (e.g. banner_slot_1)
|-
! step
| NO
| integer
| A number that represents the progress in the checkout process. Usually at a click product event, this is 0.
|-
|-
! quantity
! quantity
Line 1,572: Line 1,467:
| The quantity of a product clicked measured in the unit provided (e.g. 2).
| The quantity of a product clicked measured in the unit provided (e.g. 2).
|-
|-
! step
! variant
| NO
| NO
| integer
| text
| A number that represents the progress in the checkout process. Usually at a click product event, this is 0.
| The variant of the product (e.g. 'black') clicked.
|}
|}






'''Customize product event implementation example'''
'''Click product event implementation example'''


     <nowiki>
     <nowiki>


         // sample product data for single product
         // sample product data for single product
         var customizeProductProperties = {
         var clickProductDetailProperties = {
             'contentType': 'Product',
             'contentType': 'Product',
             'currency': 'HUF',
             'currency': 'HUF',
Line 1,592: Line 1,487:
             'unit': 'pcs',
             'unit': 'pcs',
             'unitPrice': 2500.0,
             'unitPrice': 2500.0,
            'variant': 'hardcover'
             'brand': 'Gollancz',
             'brand': 'Gollancz',
             'category': 'books|hardcover|scifi, books|hardcover|comedy',
             'category': 'books|hardcover|scifi, books|hardcover|comedy',
             'contents': []
             'contents': undefined,
             'creative': 'book_42',
             'creative': 'book_42',
             'customerValue': '150.0',
             'customerValue': '150.0',
Line 1,603: Line 1,497:
             'step': 2,
             'step': 2,
             'quantity': 1,
             'quantity': 1,
            'variant': 'hardcover'
         }
         }




         // sample product data for bundle offer
         // sample product data for bundle offer
         var customizeProductProperties = {
         var clickProductDetailProperties = {
             'contentType': 'Product',
             'contentType': 'Product',
             'currency': 'HUF',
             'currency': 'HUF',
Line 1,614: Line 1,509:
             'unit': 'pcs',
             'unit': 'pcs',
             'unitPrice': 15000.0,
             'unitPrice': 15000.0,
            'variant': 'hardcover'
             'brand': 'Gollancz',
             'brand': 'Gollancz',
             'category': 'books|hardcover|scifi, books|hardcover|comedy',
             'category': 'books|hardcover|scifi, books|hardcover|comedy',
Line 1,657: Line 1,551:
             'step': 2,
             'step': 2,
             'quantity': 1,
             'quantity': 1,
            'variant': 'hardcover'
         }
         }


Line 1,662: Line 1,557:


         // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
         // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
         document.getElementById('customize').addEventListener('click', function() {
         document.getElementById('more_details').addEventListener('click', function() {
             bp('track', 'customizeProduct', customizeProductProperties);
             bp('track', 'clickProductDetail', clickProductDetailProperties);
         });
         });


         // jQuery (if you use jQuery, if in your console "$" is defined on your site)
         // jQuery (if you use jQuery, if in your console "$" is defined on your site)
         $("#customize").click(function() {
         $("#more_details").click(function() {
             bp('track', 'customizeProduct', customizeProductProperties);
             bp('track', 'clickProductDetail', clickProductDetailProperties);
         });
         });


Line 1,674: Line 1,569:




== Customize Product (customizeProduct) ==


== Purchase (purchase) ==
* Firing event: ''Button click'' changing particular characteristics of an item
* User intent: Change characteristics of an item
* Why do we need this: Users demonstrate interest in your items by customizing them


* Firing event: ''Page load'' after the payment process
This event should fire on a button click that can be either a webpage or an asynchronous request for a different variant
* User intent: Verify the completion of the transaction
of an item, for example color, size etc. It should be implemented at any button that results in a different variant
* Why do we need this: Users usually are put off by adverts of an item they already purchased, but can be receptive to related products
being shown.


This event should be fired on the page load where the user is notified about the completion of their transaction. This
is usually a 'thank you' page, that thanks the user for their purchase and verifies that the payment was successful. If
the payment wasn't successful, then still this is the event that needs to be fire, except the 'step' property should be
given a '-1' value.




'''Customize product event properties'''


'''Purchase event properties'''
{| class="wikitable"
{| class="wikitable"
! key
! key
Line 1,695: Line 1,589:
! description
! description
|-
|-
! contents
! contentType
| YES
| YES
| array
| text
| An array of JS objects for detailing the actual items contained in the cart, meaning the shipping and coupons should be excluded. For the detailed format see the table below.
| The type of the content of the page where the item was selected. Possible values (only these are accepted): Page/Product/Article/Promotion/Banner/Misc.
|-
|-
! currency
! currency
| NO
| YES
| text (ISO 4217)
| text (ISO 4217)
| The currency that the price is provided in, preferably in the three letter ISO 4217 format (eg. HUF, EUR).
| Currency that the item is listed in for purchase. 3 digit ISO 4217 format is preferred (eg. HUF, EUR).
|-
|-
! revenue
! id
| NO
| float
| The total revenue associated with the transaction in the given currency. This should include all costs the customer pays like shipping or tax.
|-
! step
| YES
| YES
| integer
| In most cases, since this is after the last checkout step, this should be the maximum value that you use. If the transaction is unsuccessful, this should be -1.
|-
! contentType
| NO
| text
| text
| Usually this value should be "Product".
| Unique ID of the item clicked on your site.
|-
|-
! coupon
! name
| NO
| YES
| text
| text
| The coupon code that is being used.
| Full name of the item clicked.
|-
|-
! creative
! unit
| NO
| YES
| text
| text
| The name or description of the promotion for the cart, for example a promotion picture filename or slogan of the promotion that starts the checkout automatically.
| The measurement unit of the item clicked. (e.g. pcs, kg).
|-
|-
! customerValue
! unitPrice
| NO
| YES
| float
| float
| A metric that you define that measures the value of the action performed to your business.
| Price of one unit (that you provided) of the item clicked (in the currency that you provided).
|-
! variant
| YES
| text
| The variant of the product (e.g. 'black') clicked.
|-
|-
! list
! brand
| NO
| NO
| text
| text
| In most cases this should be 'Checkout'.
| Brand of the item clicked.
|-
|-
! option
! category
| NO
| NO
| text
| text
| Additional information about the purchase.
| The category (eg. 'winter shoes' or 'summer shoes') or subcategory branch (eg. 'clothes|shoes|winter' or 'clothes|shoes|summer', separate levels with '|') of the item clicked.
|-
|-
! orderNumber
! contents
| NO
| NO
| text
| array
| The unique ID of the purchase.
| An array of JS objects for detailing multiple items clicked. For more details see the table below.
|-
|-
! position
! creative
| NO
| NO
| text
| text
| The item's position in a list or collection (e.g. 2) or the position of the promotion on a page (e.g. banner_slot_1).
| The name or description of the promotion for the item, for example a promotion picture filename or slogan of the promotion that selects the item.
|-
|-
! shipping
! customerValue
| NO
| NO
| float
| float
| The price of shipping associated with the purchase in the given currency.
| The value of a user performing this event to the business.
|-
|-
! shippingAddress
! ean
| NO
| NO
| object
| text
| The shipping address given in the format detailed below.
| Contains the International Article Number (EAN) of the item if available.
|-
! list
| NO
| text
| The collection that the product clicked is in from one of these possible values: HomePage/SearchPage/ProductPage/Recommendation/ComparisonPage/BasketPage/Checkout/Misc
|-
! position
| NO
| text
| The product's position in the list or collection (e.g. 2) or the position of the creative (e.g. banner_slot_1)
|-
! quantity
| NO
| integer
| The quantity of a product clicked measured in the unit provided (e.g. 2).
|-
|-
! tax
! step
| NO
| NO
| float
| integer
| The tax associated with the purchase in the given currency.
| A number that represents the progress in the checkout process. Usually at a click product event, this is 0.
|}
|}






'''Successful purchase event implementation example'''
'''Customize product event implementation example'''


     <nowiki>
     <nowiki>


         var purchaseProperties = {
        // sample product data for single product
             'contents': [{
         var customizeProductProperties = {
                 'contentType': 'Product',
            'contentType': 'Product',
                 'currency': 'HUF',
            'currency': 'HUF',
            'id': 'item_42',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'unit': 'pcs',
            'unitPrice': 2500.0,
            'variant': 'hardcover'
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': undefined,
            'creative': 'book_42',
            'customerValue': '150.0',
            'ean': 9780575115347,
            'list': 'Checkout',
            'position': 1,
            'step': 2,
            'quantity': 1,
        }
 
 
        // sample product data for bundle offer
        var customizeProductProperties = {
            'contentType': 'Product',
            'currency': 'HUF',
            'id': 'item_42pack',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'unit': 'pcs',
            'unitPrice': 15000.0,
            'variant': 'hardcover'
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
             'contents': [{
                 'contentType': 'Product',
                 'currency': 'HUF',
                 'id': 'item_42',
                 'id': 'item_42',
                 'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                 'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
Line 1,811: Line 1,747:
                 },
                 },
             ]
             ]
             'currency': 'HUF',
             'creative': 'bundle_offer_01',
             'revenue': 17500.0,
             'customerValue': '150.0',
            'step': 7,
             'ean': 9780575115347,
             'contentType': 'Product',
            'coupon': '43763436874'
            'creative': 'preselected_cart_01',
            'customerValue': '150',
             'list': 'Checkout',
             'list': 'Checkout',
            'option': 'To postal office, no street address',
            'orderNumber': 852,
             'position': 1,
             'position': 1,
             'shipping': 2500.0,
             'step': 2,
             'shippingAddress': {
             'quantity': 1,
                'city': 'Budapest',
                'country': 'HU',
                'deliveryMethod': 'DHL',
                'fullName': 'John Doe',
                'phone': '+36 1 1111 111',
                'region': 'HU-BU',
                'street': 'Műegyetem rkpt. 3.',
                'street2': '2. porta',
                'zip': '1111'
            },
            'tax': '0.0'
         }
         }


Line 1,840: Line 1,759:


         // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
         // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
         window.addEventListener('onload', function() {
         document.getElementById('customize').addEventListener('click', function() {
             bp('track', 'purchase', purchaseProperties);
             bp('track', 'customizeProduct', customizeProductProperties);
         });
         });


         // jQuery (if you use jQuery, if in your console "$" is defined on your site)
         // jQuery (if you use jQuery, if in your console "$" is defined on your site)
         $("window").load(function() {
         $("#customize").click(function() {
             bp('track', 'purchase', purchaseProperties);
             bp('track', 'customizeProduct', customizeProductProperties);
         });
         });


Line 1,853: Line 1,772:




== Remove from Cart (removeFromCart) ==
== Purchase (purchase) ==


* Firing event: ''Button click'' that results in a product to be removed from the items selected for purchase
* Firing event: ''Page load'' after the payment process
* User intent: Deselect product for purchase
* User intent: Verify the completion of the transaction
* Why do we need this: Users demonstrate interest in carted products, and this can be refined if we know when products are deselected
* Why do we need this: Users usually are put off by adverts of an item they already purchased, but can be receptive to related products


The remove from cart event is very similar to the add to cart event, and is mainly required to refine our data on
This event should be fired on the page load where the user is notified about the completion of their transaction. This
selected items by informing us when products are taken out from the cart or deselected from purchase. It can also mean
is usually a 'thank you' page, that thanks the user for their purchase and verifies that the payment was successful. If
that a purchase process that first made a user select an item is simply cancelled.
the payment wasn't successful, then still this is the event that needs to be fire, except the 'step' property should be
given a '-1' value.






'''Remove from cart event properties'''
'''Purchase event properties'''
{| class="wikitable"
{| class="wikitable"
! key
! key
Line 1,872: Line 1,792:
! description
! description
|-
|-
! contentType
! contents
| YES
| YES
| text
| array
| Usually, this value should be "Product".
| An array of JS objects for detailing the actual items contained in the cart, meaning the shipping and coupons should be excluded. For the detailed format see the table below.
|-
|-
! currency
! currency
| YES
| NO
| text (ISO 4217)
| text (ISO 4217)
| The currency that the price is provided in, preferably in the three letter ISO 4217 format (eg. HUF, EUR).
| The currency that the price is provided in, preferably in the three letter ISO 4217 format (eg. HUF, EUR).
|-
|-
! id
! revenue
| YES
| NO
| text
| float
| An unique ID that you have for the item, this can be your ID for the product, an SKU or a promotion ID.
| The total revenue associated with the transaction in the given currency. This should include all costs the customer pays like shipping or tax.
|-
|-
! name
! step
| YES
| YES
| text
| integer
| The full name that you have for the added item, for example a product name (eg. Red Bull 24pcs carton).
| In most cases, since this is after the last checkout step, this should be the maximum value that you use. If the transaction is unsuccessful, this should be -1.
|-
|-
! quantity
! contentType
| YES
| NO
| float
| The quantity of the item removed from the cart.
|-
! totalItemPrice
| YES
| float
| The total price of the removed items in the given currency.
|-
! unit
| YES
| text
| text
| The unit that your item is measured in (eg. pieces, kg, hours).
| Usually this value should be "Product".
|-
|-
! unitPrice
! coupon
| YES
| float
| The price of one measurement of your item in the given currency.
|-
! brand
| NO
| NO
| text
| text
| The brand of the item.
| The coupon code that is being used.
|-
|-
! category
! creative
| NO
| NO
| text
| text
| | The subcategory branch (preferred, eg. 'clothes|shoes|winter', separate levels with '|') or single category (eg. 'winter shoes' or 'summer shoes') of the item.
| The name or description of the promotion for the cart, for example a promotion picture filename or slogan of the promotion that starts the checkout automatically.
|-
|-
! contents
! customerValue
| NO
| NO
| array
| float
| An array of JS objects for detailing multiple items of the item. For more details see the table below.
| A metric that you define that measures the value of the action performed to your business.
|-
|-
! coupon
! list
| NO
| NO
| text
| text
| The coupon code that was used when the item was removed from cart.
| In most cases this should be 'Checkout'.
|-
|-
! creative
! option
| NO
| NO
| text
| text
| Seldom used, for example a promotion that changes a product in your cart to a better, more expensive or more recent one.
| Additional information about the purchase.
|-
|-
! customerValue
! orderNumber
| NO
| float
| A metric that you define that measures the value of the action performed to your business.
|-
! ean
| NO
| NO
| text
| text
| Contains the International Article Number (EAN) of the item if available.
| The unique ID of the purchase.
|-
! list
| NO
| text
| The function of the loaded page from one of these possible values: HomePage/SearchPage/ProductPage/Recommendation/ComparisonPage/BasketPage/Checkout/Misc
|-
|-
! position
! position
Line 1,957: Line 1,852:
| The item's position in a list or collection (e.g. 2) or the position of the promotion on a page (e.g. banner_slot_1).
| The item's position in a list or collection (e.g. 2) or the position of the promotion on a page (e.g. banner_slot_1).
|-
|-
! step
! shipping
| NO
| NO
| integer
| float
| If the page is displayed along the checkout process, the checkout step number that the page is displayed in, numbered from 0 as the checkout initiation.
| The price of shipping associated with the purchase in the given currency.
|-
|-
! variant
! shippingAddress
| NO
| object
| The shipping address given in the format detailed below.
|-
! tax
| NO
| NO
| text
| float
| The variant of the offer from the list of possible identical items (eg. the color of a phone or the time and venue of a concert or movie)
| The tax associated with the purchase in the given currency.
|}
|}






'''Remove from cart event implementation example'''
'''Successful purchase event implementation example'''


     <nowiki>
     <nowiki>


        // sample product data for single items
         var purchaseProperties = {
         var removeFromCartProperties = {
             'contents': [{
             'contentType': 'Product',
                'contentType': 'Product',
            'currency': 'HUF',
                'currency': 'HUF',
            'id': 'item_42',
                'id': 'item_42',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'quantity': '10',
                'quantity': 3,
            'totalItemPrice': 49900.0,
                'totalItemPrice': 7500.0,
            'unit': 'pcs.',
                'unit': 'pcs',
            'unitPrice': 4990.0,
                'unitPrice': 2500.0,
            'brand': 'Gollancz',
                'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
             'contents': undefined,
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
                {
                'contentType': 'Product',
                'currency': 'USD',
                'id': 'item_42en',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 25.935,
                'unit': 'pcs',
                'unitPrice': 8.645,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
             ]
            'currency': 'HUF',
            'revenue': 17500.0,
            'step': 7,
            'contentType': 'Product',
             'coupon': '43763436874'
             'coupon': '43763436874'
             'creative': 'upsell_promo_42',
             'creative': 'preselected_cart_01',
             'customerValue': '150',
             'customerValue': '150',
             'ean': 9780575115347,
             'list': 'Checkout',
             'list': 'BasketPage',
             'option': 'To postal office, no street address',
             'position': 3,
            'orderNumber': 852,
            'step': 2,
             'position': 1,
             'variant': 'hardcover'
            'shipping': 2500.0,
            'shippingAddress': {
                'city': 'Budapest',
                'country': 'HU',
                'deliveryMethod': 'DHL',
                'fullName': 'John Doe',
                'phone': '+36 1 1111 111',
                'region': 'HU-BU',
                'street': 'Műegyetem rkpt. 3.',
                'street2': '2. porta',
                'zip': '1111'
            },
             'tax': '0.0'
         }
         }


         // sample product data for bundled items
         bp('track', 'purchase', purchaseProperties);
        var removeFromCartProperties = {
 
            'contentType': 'Product',
    </nowiki>
            'currency': 'HUF',
 
            'id': 'item_42pack',
 
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
 
            'quantity': '10',
== Remove from Cart (removeFromCart) ==
            'totalItemPrice': 150000.0,
 
            'unit': 'pcs.',
* Firing event: ''Button click'' that results in a product to be removed from the items selected for purchase
            'unitPrice': 15000.0,
* User intent: Deselect product for purchase
            'brand': 'Gollancz',
* Why do we need this: Users demonstrate interest in carted products, and this can be refined if we know when products are deselected
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
 
            'contents': [{
The remove from cart event is very similar to the add to cart event, and is mainly required to refine our data on
                'contentType': 'Product',
selected items by informing us when products are taken out from the cart or deselected from purchase. It can also mean
                'currency': 'HUF',
that a purchase process that first made a user select an item is simply cancelled.
                'id': 'item_42',
 
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
 
                'quantity': 3,
 
                'totalItemPrice': 7500.0,
'''Remove from cart event properties'''
                'unit': 'pcs',
{| class="wikitable"
                'unitPrice': 2500.0,
! key
                'brand': 'Gollancz',
! required
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
! type
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
! description
                'ean': 9780575115347,
|-
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
! contentType
                'variant': 'hardcover'
| YES
                },
| text
                {
| Usually, this value should be "Product".
                'contentType': 'Product',
|-
                'currency': 'USD',
! currency
                'id': 'item_42en',
| YES
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
| text (ISO 4217)
                'quantity': 3,
| The currency that the price is provided in, preferably in the three letter ISO 4217 format (eg. HUF, EUR).
                'totalItemPrice': 25.935,
|-
                'unit': 'pcs',
! id
                'unitPrice': 8.645,
| YES
                'brand': 'Gollancz',
| text
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
| An unique ID that you have for the item, this can be your ID for the product, an SKU or a promotion ID.
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
|-
                'ean': 9780575115347,
! name
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
| YES
                'variant': 'hardcover'
| text
                },
| The full name that you have for the added item, for example a product name (eg. Red Bull 24pcs carton).
            'coupon': '43763436874'
|-
            'creative': 'upsell_promo_42',
! quantity
            'customerValue': '150',
| YES
            'ean': 9780575115347,
| float
            'list': 'BasketPage',
| The quantity of the item removed from the cart.
            'position': 3,
|-
            'step': undefined,
! totalItemPrice
            'variant': 'hardcover'
| YES
        }
| float
 
| The total price of the removed items in the given currency.
        // Use one of these to add the event listener to the button click (use only one):
|-
 
! unit
        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
| YES
        document.getElementById('remove_button').addEventListener('click', function() {
| text
            bp('track', 'removeFromCart', removeFromCartProperties);
| The unit that your item is measured in (eg. pieces, kg, hours).
        });
|-
 
! unitPrice
        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
| YES
        $("#remove_button").click(function() {
| float
            bp('track', 'removeFromCart', removeFromCartProperties);
| The price of one measurement of your item in the given currency.
        });
|-
 
! brand
    </nowiki>
| NO
 
| text
 
| The brand of the item.
== Add Payment Info (addPaymentInfo) ==
|-
 
! category
* Firing event: ''Button click'' at a point in the checkout process where the payment method is already set
| NO
* User intent: Select payment method
| text
* Why do we need this: It helps to identify user financial habits
| | The subcategory branch (preferred, eg. 'clothes|shoes|winter', separate levels with '|') or single category (eg. 'winter shoes' or 'summer shoes') of the item.
 
|-
This event should be fired when the payment method of a user is already entered. This event should be fired both if
the payment info is explicitly requested and provided, but also if it is only implied for example when only one option
is available.
 
 
 
'''Add payment info event properties'''
{| class="wikitable"
! key
! required
! type
! description
|-
! contents
! contents
| YES
| NO
| array
| array
| An array of JS objects for detailing the actual items contained in the cart, meaning the shipping and coupons should be excluded. For the detailed format see the table below.
| An array of JS objects for detailing multiple items of the item. For more details see the table below.
|-
|-
! currency
! coupon
| YES
| NO
| text (ISO 4217)
| text
| The currency that the price is provided in, preferably in the three letter ISO 4217 format (eg. HUF, EUR).
| The coupon code that was used when the item was removed from cart.
|-
|-
! paymentMethod
! creative
| YES
| NO
| text
| text
| The method of payment that the user chooses, for example Barion, cash etc.
| Seldom used, for example a promotion that changes a product in your cart to a better, more expensive or more recent one.
|-
|-
! revenue
! customerValue
| YES
| NO
| float
| float
| The total revenue associated with the transaction in the given currency. This should include all costs the customer pays like shipping or tax.
| A metric that you define that measures the value of the action performed to your business.
|-
|-
! step
! ean
| YES
| integer
| In most cases, since this is the first checkout step, this should be 0.
|-
! contentType
| NO
| NO
| text
| text
| Usually this value should be "Product".
| Contains the International Article Number (EAN) of the item if available.
|-
|-
! coupon
! list
| NO
| NO
| text
| text
| The coupon code that is being used.
| The function of the loaded page from one of these possible values: HomePage/SearchPage/ProductPage/Recommendation/ComparisonPage/BasketPage/Checkout/Misc
|-
|-
! creative
! position
| NO
| NO
| text
| text
| The name or description of the promotion for the cart, for example a promotion picture filename or slogan of the promotion that starts the checkout automatically.
| The item's position in a list or collection (e.g. 2) or the position of the promotion on a page (e.g. banner_slot_1).
|-
|-
! customerValue
! step
| NO
| NO
| float
| integer
| A metric that you define that measures the value of the action performed to your business.
| If the page is displayed along the checkout process, the checkout step number that the page is displayed in, numbered from 0 as the checkout initiation.
|-
|-
! list
! variant
| NO
| NO
| text
| text
| In most cases this should be 'Checkout'.
| The variant of the offer from the list of possible identical items (eg. the color of a phone or the time and venue of a concert or movie)
|-
|}
! option
 
| NO
 
| text
 
| Additional information about the purchase.
'''Remove from cart event implementation example'''
|-
 
! orderNumber
    <nowiki>
| NO
 
| text
        // sample product data for single items
| The unique ID of the purchase.
        var removeFromCartProperties = {
|-
            'contentType': 'Product',
! position
            'currency': 'HUF',
| NO
            'id': 'item_42',
| text
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
| The item's position in a list or collection (e.g. 2) or the position of the promotion on a page (e.g. banner_slot_1).
            'quantity': '10',
|-
            'totalItemPrice': 49900.0,
! shipping
            'unit': 'pcs.',
| NO
            'unitPrice': 4990.0,
| float
            'brand': 'Gollancz',
| The price of shipping associated with the purchase in the given currency.
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
|-
            'contents': undefined,
! shippingAddress
            'coupon': '43763436874'
| NO
            'creative': 'upsell_promo_42',
| object
            'customerValue': '150',
| The shipping address given in the format detailed below.
            'ean': 9780575115347,
|-
            'list': 'BasketPage',
! tax
            'position': 3,
| NO
            'step': 2,
| float
            'variant': 'hardcover'
| The tax associated with the purchase in the given currency.
        }
|}


 
        // sample product data for bundled items
 
        var removeFromCartProperties = {
'''Add payment info event implementation example'''
            'contentType': 'Product',
 
            'currency': 'HUF',
    <nowiki>
            'id': 'item_42pack',
 
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
        // sample product data
            'quantity': '10',
        var addPaymentInfoProperties = {
            'totalItemPrice': 150000.0,
            'unit': 'pcs.',
            'unitPrice': 15000.0,
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
             'contents': [{
             'contents': [{
                 'contentType': 'Product',
                 'contentType': 'Product',
Line 2,206: Line 2,128:
                 'variant': 'hardcover'
                 'variant': 'hardcover'
                 },
                 },
            ]
            'currency': 'HUF',
            'paymentMethod': 'Barion'
            'revenue': 17500.0,
            'step': 0,
            'contentType': 'Product',
             'coupon': '43763436874'
             'coupon': '43763436874'
             'creative': 'preselected_cart_01',
             'creative': 'upsell_promo_42',
             'customerValue': '150',
             'customerValue': '150',
             'list': 'Checkout',
             'ean': 9780575115347,
             'option': 'To postal office, no street address',
             'list': 'BasketPage',
            'orderNumber': 852,
             'position': 3,
             'position': 1,
             'step': undefined,
            'shipping': 2500.0,
             'variant': 'hardcover'
             'shippingAddress': {
                'city': 'Budapest',
                'country': 'HU',
                'deliveryMethod': 'DHL',
                'fullName': 'John Doe',
                'phone': '+36 1 1111 111',
                'region': 'HU-BU',
                'street': 'Műegyetem rkpt. 3.',
                'street2': '2. porta',
                'zip': '1111'
            },
             'tax': '0.0'
         }
         }


Line 2,237: Line 2,141:


         // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
         // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
         document.getElementById('checkout_next').addEventListener('click', function() {
         document.getElementById('remove_button').addEventListener('click', function() {
             bp('track', 'addPaymentInfo', addPaymentInfoProperties);
             bp('track', 'removeFromCart', removeFromCartProperties);
         });
         });


         // jQuery (if you use jQuery, if in your console "$" is defined on your site)
         // jQuery (if you use jQuery, if in your console "$" is defined on your site)
         $("#checkout_next").click(function() {
         $("#remove_button").click(function() {
             bp('track', 'addPaymentInfo', addPaymentInfoProperties);
             bp('track', 'removeFromCart', removeFromCartProperties);
         });
         });


Line 2,249: Line 2,153:




== Add Payment Info (addPaymentInfo) ==


== Click Promo (clickPromo) ==
* Firing event: ''Button click'' at a point in the checkout process where the payment method is already set
* User intent: Select payment method
* Why do we need this: It helps to identify user financial habits


* Firing event: ''Button click'' on a promotion box
This event should be fired when the payment method of a user is already entered. This event should be fired both if
* User intent: View a promotion
the payment info is explicitly requested and provided, but also if it is only implied for example when only one option
* Why do we need this: Users demonstrate interest in your promotion offers by clicking them
is available.


This event should be fired when one of your users selects a promotion. Promotions can be usually placed on home pages,
product places, in the checkout process and many other places. The promotion can be about a product, offer, brand or any
other single offer or grouping of offers.




'''Click product event properties'''
'''Add payment info event properties'''
 
{| class="wikitable"
{| class="wikitable"
! key
! key
Line 2,269: Line 2,172:
! description
! description
|-
|-
! contentType
! contents
| YES
| YES
| text
| array
| The type of the content of the page where the promotion was selected. Possible values (only these are accepted): Page/Product/Article/Promotion/Banner/Misc.
| An array of JS objects for detailing the actual items contained in the cart, meaning the shipping and coupons should be excluded. For the detailed format see the table below.
|-
|-
! creative
! currency
| YES
| YES
| text
| text (ISO 4217)
| The name or description of the promotion, for example a promotion picture filename or slogan of the promotion.
| The currency that the price is provided in, preferably in the three letter ISO 4217 format (eg. HUF, EUR).
|-
|-
! id
! paymentMethod
| YES
| YES
| text
| text
| Unique ID of the promotion clicked on your site.
| The method of payment that the user chooses, for example Barion, cash etc.
|-
|-
! name
! revenue
| YES
| YES
| text
| float
| Full name of the promotion.
| The total revenue associated with the transaction in the given currency. This should include all costs the customer pays like shipping or tax.
|-
|-
! brand
! step
| YES
| integer
| In most cases, since this is the first checkout step, this should be 0.
|-
! contentType
| NO
| NO
| text
| text
| Brand of the item in the promotion clicked.
| Usually this value should be "Product".
|-
|-
! category
! coupon
| NO
| NO
| text
| text
| | The category (eg. 'winter shoes' or 'summer shoes') or subcategory branch (eg. 'clothes|shoes|winter' or 'clothes|shoes|summer', separate levels with '|') of the item in the promotion clicked.
| The coupon code that is being used.
|-
|-
! contents
! creative
| NO
| NO
| array
| text
| An array of JS objects for detailing multiple items promoted. For more details see the table below.
| The name or description of the promotion for the cart, for example a promotion picture filename or slogan of the promotion that starts the checkout automatically.
|-
! currency
| NO
| text (ISO 4217)
| Currency that the promoted offer is listed in. 3 digit ISO 4217 format is preferred (eg. HUF, EUR).
|-
|-
! customerValue
! customerValue
| NO
| NO
| float
| float
| The value of a user performing this event to the business.
| A metric that you define that measures the value of the action performed to your business.
|-
|-
! ean
! list
| NO
| NO
| text
| text
| Contains the International Article Number (EAN) of the item if available.
| In most cases this should be 'Checkout'.
|-
|-
! list
! option
| NO
| NO
| text
| text
| The collection that the promotion clicked is in from one of these possible values: HomePage/SearchPage/ProductPage/Recommendation/ComparisonPage/BasketPage/Checkout/Misc
| Additional information about the purchase.
|-
|-
! position
! orderNumber
| NO
| NO
| text
| text
| The promotion's position in the list or collection (e.g. 2) or the position of the creative (e.g. banner_slot_1)
| The unique ID of the purchase.
|-
|-
! quantity
! position
| NO
| NO
| integer
| text
| The quantity that the item is promoted in, measured in the unit provided (e.g. 2).
| The item's position in a list or collection (e.g. 2) or the position of the promotion on a page (e.g. banner_slot_1).
|-
|-
! step
! shipping
| NO
| NO
| integer
| float
| A number that represents the progress in the checkout process. Usually at a click product event, this is 0.
| The price of shipping associated with the purchase in the given currency.
|-
|-
! unit
! shippingAddress
| NO
| NO
| text
| object
| The measurement unit of the item promoted (e.g. pcs, kg).
| The shipping address given in the format detailed below.
|-
|-
! unitPrice
! tax
| NO
| NO
| float
| float
| Price of one unit (that you provided) of the item promoted (in the currency that you provided).
| The tax associated with the purchase in the given currency.
|-
! variant
| NO
| text
| The variant of the product (e.g. 'black') promoted.
|}
|}






'''Click promo event implementation example'''
'''Add payment info event implementation example'''


     <nowiki>
     <nowiki>


         // sample product data for single product
         // sample product data
         var clickPromoProperties = {
         var addPaymentInfoProperties = {
            'contentType': 'Product',
            'creative': 'book_42',
            'id': 'item_42',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': []
            'currency': 'HUF',
            'customerValue': '150.0',
            'ean': 9780575115347,
            'list': 'Checkout',
            'position': 1,
            'quantity': 1,
            'step': 2,
            'unit': 'pcs',
            'unitPrice': 2500.0,
            'variant': 'hardcover'
        }
 
 
        // sample product data for bundle offer
        var clickPromoProperties = {
            'contentType': 'Product',
            'creative': 'bundle_offer_01',
            'id': 'item_42pack',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
             'contents': [{
             'contents': [{
                 'contentType': 'Product',
                 'contentType': 'Product',
Line 2,425: Line 2,295:
             ]
             ]
             'currency': 'HUF',
             'currency': 'HUF',
             'customerValue': '150.0',
             'paymentMethod': 'Barion'
             'ean': 9780575115347,
            'revenue': 17500.0,
            'step': 0,
             'contentType': 'Product',
            'coupon': '43763436874'
            'creative': 'preselected_cart_01',
            'customerValue': '150',
             'list': 'Checkout',
             'list': 'Checkout',
            'option': 'To postal office, no street address',
            'orderNumber': 852,
             'position': 1,
             'position': 1,
             'quantity': 1,
             'shipping': 2500.0,
            'step': 2,
            'shippingAddress': {
            'unit': 'pcs',
                'city': 'Budapest',
            'unitPrice': 15000.0,
                'country': 'HU',
             'variant': 'hardcover'
                'deliveryMethod': 'DHL',
                'fullName': 'John Doe',
                'phone': '+36 1 1111 111',
                'region': 'HU-BU',
                'street': 'Műegyetem rkpt. 3.',
                'street2': '2. porta',
                'zip': '1111'
            },
             'tax': '0.0'
         }
         }


Line 2,439: Line 2,324:


         // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
         // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
         document.getElementById('book_42_promo').addEventListener('click', function() {
         document.getElementById('checkout_next').addEventListener('click', function() {
             bp('track', 'clickPromo', clickPromoProperties);
             bp('track', 'addPaymentInfo', addPaymentInfoProperties);
         });
         });


         // jQuery (if you use jQuery, if in your console "$" is defined on your site)
         // jQuery (if you use jQuery, if in your console "$" is defined on your site)
         $("#book_42_promo").click(function() {
         $("#checkout_next").click(function() {
             bp('track', 'clickPromo', clickPromoProperties);
             bp('track', 'addPaymentInfo', addPaymentInfoProperties);
         });
         });


Line 2,452: Line 2,337:




== Sign Up (signUp) ==
== Click Promo (clickPromo) ==


* Firing event: ''Button click'' that completes the registration or login process
* Firing event: ''Button click'' on a promotion box
* User intent: Register for or login to a user account or a newsletter subscription
* User intent: View a promotion
* Why do we need this: Users demonstrate interest in your market area by signing up for an account
* Why do we need this: Users demonstrate interest in your promotion offers by clicking them


This event should be usually sent along the set user properties event, since this event only captures the actual signup,
This event should be fired when one of your users selects a promotion. Promotions can be usually placed on home pages,
not the user itself. This event should both be fired if a user registers for an account or subscription for the first
product places, in the checkout process and many other places. The promotion can be about a product, offer, brand or any
time and when they login afterwards. Unsuccessful login or signup events should cause error events to be sent. If
other single offer or grouping of offers.
possible, it is better if only successful attempts send a sign up event, but it is more important for all signing ups to
send an event than for each signup to be only sent once.




'''Click product event properties'''


'''Add to cart event properties'''
{| class="wikitable"
{| class="wikitable"
! key
! key
Line 2,476: Line 2,359:
| YES
| YES
| text
| text
| If the user signs up for a product, then it should be 'Product' else this can be 'Page' if it is a general registration or login.
| The type of the content of the page where the promotion was selected. Possible values (only these are accepted): Page/Product/Article/Promotion/Banner/Misc.
|-
! creative
| YES
| text
| The name or description of the promotion, for example a promotion picture filename or slogan of the promotion.
|-
|-
! id
! id
| YES
| YES
| text
| text
| This should be your unique ID for the form used to register or login.
| Unique ID of the promotion clicked on your site.
|-
|-
! name
! name
| YES
| YES
| text
| text
| The name of the for used for the signing up, for example 'Register' or 'Sign In'.
| Full name of the promotion.
|-
|-
! brand
! brand
| NO
| NO
| text
| text
| The brand of the product the user signs up for.
| Brand of the item in the promotion clicked.
|-
|-
! category
! category
| NO
| NO
| text
| text
| | The subcategory branch (preferred, eg. 'clothes|shoes|winter', separate levels with '|') or single category (eg. 'winter shoes' or 'summer shoes') of the item.
| | The category (eg. 'winter shoes' or 'summer shoes') or subcategory branch (eg. 'clothes|shoes|winter' or 'clothes|shoes|summer', separate levels with '|') of the item in the promotion clicked.
|-
|-
! contents
! contents
| NO
| NO
| array
| array
| An array of JS objects for detailing multiple items of the item. For more details see the table below.
| An array of JS objects for detailing multiple items promoted. For more details see the table below.
|-
|-
! currency
! currency
| NO
| NO
| text (ISO 4217)
| text (ISO 4217)
| The currency that the price is provided in, preferably in the three letter ISO 4217 format (eg. HUF, EUR).
| Currency that the promoted offer is listed in. 3 digit ISO 4217 format is preferred (eg. HUF, EUR).
|-
|-
! customerValue
! customerValue
| NO
| NO
| float
| float
| A metric that you define that measures the value of the action performed to your business.
| The value of a user performing this event to the business.
|-
|-
! ean
! ean
| NO
| NO
| text
| text
| Contains the International Article Number (EAN) of the offer if available.
| Contains the International Article Number (EAN) of the item if available.
|-
! list
| NO
| text
| The collection that the promotion clicked is in from one of these possible values: HomePage/SearchPage/ProductPage/Recommendation/ComparisonPage/BasketPage/Checkout/Misc
|-
! position
| NO
| text
| The promotion's position in the list or collection (e.g. 2) or the position of the creative (e.g. banner_slot_1)
|-
! quantity
| NO
| integer
| The quantity that the item is promoted in, measured in the unit provided (e.g. 2).
|-
|-
! totalItemPrice
! step
| NO
| NO
| float
| integer
| The total price of the subscribed items in the given currency.
| A number that represents the progress in the checkout process. Usually at a click product event, this is 0.
|-
|-
! unit
! unit
| NO
| NO
| text
| text
| The unit that your subscribed item is measured in (eg. pieces, kg, hours).
| The measurement unit of the item promoted (e.g. pcs, kg).
|-
|-
! unitPrice
! unitPrice
| NO
| NO
| float
| float
| The price of one measurement of your item in the given currency.
| Price of one unit (that you provided) of the item promoted (in the currency that you provided).
|-
|-
! variant
! variant
| NO
| NO
| text
| text
| THehvariant of the offer from the list of possible identical items (eg. the color of a phone or the time and venue of a concert or movie)
| The variant of the product (e.g. 'black') promoted.
|}
|}






'''Sign up event implementation example'''
'''Click promo event implementation example'''


     <nowiki>
     <nowiki>


         // sample subscription data
         // sample product data for single product
         var signUpProperties = {
         var clickPromoProperties = {
             'contentType': 'Product',
             'contentType': 'Product',
            'creative': 'book_42',
             'id': 'item_42',
             'id': 'item_42',
             'name': "Hitchhikers' Guide to the Galaxy, newsletter",
             'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
             'brand': 'Gollancz',
             'brand': 'Gollancz',
             'category': 'books|hardcover|scifi, books|hardcover|comedy',
             'category': 'books|hardcover|scifi, books|hardcover|comedy',
             'contents': undefined,
             'contents': undefined,
             'currency': 'HUF',
             'currency': 'HUF',
             'customerValue': '150',
             'customerValue': '150.0',
             'ean': 9780575115347,
             'ean': 9780575115347,
             'totalItemPrice': 49900.0,
             'list': 'Checkout',
             'unit': 'pcs.',
            'position': 1,
             'unitPrice': 4990.0,
            'quantity': 1,
            'step': 2,
             'unit': 'pcs',
             'unitPrice': 2500.0,
             'variant': 'hardcover'
             'variant': 'hardcover'
         }
         }




         // Use one of these to add the event listener to the button click (use only one):
        // sample product data for bundle offer
 
        var clickPromoProperties = {
         // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
            'contentType': 'Product',
         document.getElementById('signup_button').addEventListener('click', function() {
            'creative': 'bundle_offer_01',
             bp('track', 'signUp', signUpProperties);
            'id': 'item_42pack',
         });
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
 
            'brand': 'Gollancz',
         // jQuery (if you use jQuery, if in your console "$" is defined on your site)
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
         $("#signup_button").click(function() {
            'contents': [{
             bp('track', 'signUp', signUpProperties);
                'contentType': 'Product',
         });
                'currency': 'HUF',
                'id': 'item_42',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 7500.0,
                'unit': 'pcs',
                'unitPrice': 2500.0,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
                {
                'contentType': 'Product',
                'currency': 'USD',
                'id': 'item_42en',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 25.935,
                'unit': 'pcs',
                'unitPrice': 8.645,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
            ]
            'currency': 'HUF',
            'customerValue': '150.0',
            'ean': 9780575115347,
            'list': 'Checkout',
            'position': 1,
            'quantity': 1,
            'step': 2,
            'unit': 'pcs',
            'unitPrice': 15000.0,
            'variant': 'hardcover'
        }
 
        // Use one of these to add the event listener to the button click (use only one):
 
        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('book_42_promo').addEventListener('click', function() {
            bp('track', 'clickPromo', clickPromoProperties);
        });
 
        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("#book_42_promo").click(function() {
            bp('track', 'clickPromo', clickPromoProperties);
        });
 
    </nowiki>
 
 
 
== Sign Up (signUp) ==
 
* Firing event: ''Button click'' that completes the registration or login process
* User intent: Register for or login to a user account or a newsletter subscription
* Why do we need this: Users demonstrate interest in your market area by signing up for an account
 
This event should be usually sent along the set user properties event, since this event only captures the actual signup,
not the user itself. This event should both be fired if a user registers for an account or subscription for the first
time and when they login afterwards. Unsuccessful login or signup events should cause error events to be sent. If
possible, it is better if only successful attempts send a sign up event, but it is more important for all signing ups to
send an event than for each signup to be only sent once.
 
 
 
'''Add to cart event properties'''
{| class="wikitable"
! key
! required
! type
! description
|-
! contentType
| YES
| text
| If the user signs up for a product, then it should be 'Product' else this can be 'Page' if it is a general registration or login.
|-
! id
| YES
| text
| This should be your unique ID for the form used to register or login.
|-
! name
| YES
| text
| The name of the for used for the signing up, for example 'Register' or 'Sign In'.
|-
! brand
| NO
| text
| The brand of the product the user signs up for.
|-
! category
| NO
| text
| | The subcategory branch (preferred, eg. 'clothes|shoes|winter', separate levels with '|') or single category (eg. 'winter shoes' or 'summer shoes') of the item.
|-
! contents
| NO
| array
| An array of JS objects for detailing multiple items of the item. For more details see the table below.
|-
! currency
| NO
| text (ISO 4217)
| The currency that the price is provided in, preferably in the three letter ISO 4217 format (eg. HUF, EUR).
|-
! customerValue
| NO
| float
| A metric that you define that measures the value of the action performed to your business.
|-
! ean
| NO
| text
| Contains the International Article Number (EAN) of the offer if available.
|-
! totalItemPrice
| NO
| float
| The total price of the subscribed items in the given currency.
|-
! unit
| NO
| text
| The unit that your subscribed item is measured in (eg. pieces, kg, hours).
|-
! unitPrice
| NO
| float
| The price of one measurement of your item in the given currency.
|-
! variant
| NO
| text
| THehvariant of the offer from the list of possible identical items (eg. the color of a phone or the time and venue of a concert or movie)
|}
 
 
 
'''Sign up event implementation example'''
 
    <nowiki>
 
        // sample subscription data
        var signUpProperties = {
            'contentType': 'Product',
            'id': 'item_42',
            'name': "Hitchhikers' Guide to the Galaxy, newsletter",
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': undefined,
            'currency': 'HUF',
            'customerValue': '150',
            'ean': 9780575115347,
            'totalItemPrice': 49900.0,
            'unit': 'pcs.',
            'unitPrice': 4990.0,
            'variant': 'hardcover'
        }
 
 
         // Use one of these to add the event listener to the button click (use only one):
 
         // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
         document.getElementById('signup_button').addEventListener('click', function() {
             bp('track', 'signUp', signUpProperties);
         });
 
         // jQuery (if you use jQuery, if in your console "$" is defined on your site)
         $("#signup_button").click(function() {
             bp('track', 'signUp', signUpProperties);
         });


     </nowiki>
     </nowiki>
Line 2,580: Line 2,667:


== Search (search) ==
== Search (search) ==
 
 
* Firing event: ''Button click'' that starts a search on a page
* Firing event: ''Button click'' that starts a search on a page
* User intent: Search for an offer on your page
* User intent: Search for an offer on your page
* Why do we need this: Users demonstrate interest in an offer by searching for it
* Why do we need this: Users demonstrate interest in an offer by searching for it
 
 
This event is quite straightforward, every time a search button is clicked, this should send. If the search has no
This event is quite straightforward, every time a search button is clicked, this should send. If the search has no
search button, but instead gives results on the change of the search box, then this event can be sent if the user clicks
search button, but instead gives results on the change of the search box, then this event can be sent if the user clicks
on a result. In this case, searches are sent asynchronously for partial search terms, which should not in themselves
on a result. In this case, searches are sent asynchronously for partial search terms, which should not in themselves
send an event. If you have a product selection page where items can be filtered, then the same can apply, the search
send an event. If you have a product selection page where items can be filtered, then the same can apply, the search
string in this case can be the query that the settings make that can be read in your browser address bar in HTTP
string in this case can be the query that the settings make that can be read in your browser address bar in HTTP
properties (eg. 'goats' in this: 'https://www.google.com/search?ei=A3rRXNHmJY-nrgSJs5HgDQ&q=goats').
properties (eg. 'goats' in this: 'https://www.google.com/search?ei=A3rRXNHmJY-nrgSJs5HgDQ&q=goats').
 
 
 
 
 
 
'''Search event properties'''
'''Search event properties'''
{| class="wikitable"
{| class="wikitable"
! key
! key
! required
! required
! type
! type
! description
! description
|-
|-
! searchString
! searchString
| YES
| YES
| text
| The search terms entered by the user or the HTTP property that contains the search terms.
|-
! contents
| NO
| array
| An array of JS objects containing the top ten results of your search.
|-
! contentType
| NO
| text
| Usually this should be 'Product'.
|-
! currency
| NO
| text (ISO 4217)
| If you have a filter that selects products by price, and the search string doesn't contain this, then you should provide it here.
|-
! customerValue
| NO
| float
| A metric that you define that measures the value of the action performed to your business.
|-
! id
| NO
| float
| The id of the search facility that the search is made in, for example of a search box or a filter array.
|-
! name
| NO
| text
| The name of the search facility that the search is made in, for example of a search box or a filter array.
|-
! totalResults
| NO
| integer
| The number of the search or filter results.
|}
 
 
 
'''Search event implementation example'''
 
    <nowiki>
 
        // sample search result data
        var searchProperties = {
            'searchString': 'BIG goats',
            'contents': [{
                'contentType': 'Product',
                'currency': 'HUF',
                'id': 'item_42',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 7500.0,
                'unit': 'pcs',
                'unitPrice': 2500.0,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
                {
                'contentType': 'Product',
                'currency': 'USD',
                'id': 'item_42en',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 25.935,
                'unit': 'pcs',
                'unitPrice': 8.645,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                }],
            'contentType': 'Product',
            'currency': undefined,
            'customerValue': 150.0,
            'id': 'search_01',
            'name': 'Book Search',
            'totalResults': 2
            }
        }
 
 
        // Use one of these to add the event listener to the button click (use only one):
 
        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('search_button').addEventListener('click', function() {
            bp('track', 'search', searchProperties);
        });
 
        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("#search_button").click(function() {
            bp('track', 'search', searchProperties);
        });
 
    </nowiki>
 
 
 
== Error (error) ==
 
* Firing event: Any event that results in erroneous operation
* User intent: Something else
* Why do we need this: We can get more information about event failures
 
This event should be sent each time the page can't complete the requested operation, for examnple on 40x or 50x pages,
failed form submissions et cetera.
 
 
 
'''Error event properties'''
{| class="wikitable"
! key
! required
! type
! description
|-
! description
| YES
| text
| The description of the error, or preferably the full error message.
|-
! code
| NO
| int
| The error code.
|}
 
 
 
'''Error event implementation example'''
 
    <nowiki>
 
        // on a static 404 page
        var errorProperties = {
            'description': 'I find your lack of navigation disturbing.',
            'code': 404
            }
        }
 
 
        bp('track', 'error', errorProperties);
 
    </nowiki>
 
 
 
== Custom Event (customEvent) ==
 
* Firing event: Any action that can't be described with our events
* User intent: Something different
* Why do we need this: We can get more information
 
This event is for describing any event that can't be otherwise described with our standard events.
 
 
 
'''Error event properties'''
{| class="wikitable"
! key
! required
! type
! description
|-
! eventAction
| NO
| text
| The action that the user takes, eg. click.
|-
! eventCategory
| NO
| text
| The category that the event falls in, you can define it for yourself, eg. 'user_settings'.
|-
! eventLabel
| NO
| text
| text
| The search terms entered by the user or the HTTP property that contains the search terms.
| The label associated with the event, eg. 'language_selection'.
|-
! contents
| NO
| array
| An array of JS objects containing the top ten results of your search.
|-
|-
! contentType
! eventProperty
| NO
| NO
| text
| text
| Usually this should be 'Product'.
| The property associated with the event, eg. 'unit_format'.
|-
! currency
| NO
| text (ISO 4217)
| If you have a filter that selects products by price, and the search string doesn't contain this, then you should provide it here.
|-
|-
! customerValue
! eventValue
| NO
| float
| A metric that you define that measures the value of the action performed to your business.
|-
! id
| NO
| float
| The id of the search facility that the search is made in, for example of a search box or a filter array.
|-
! name
| NO
| NO
| text
| text
| The name of the search facility that the search is made in, for example of a search box or a filter array.
| The value of the property associated with the event, eg. 'metric'.
|-
! totalResults
| NO
| integer
| The number of the search or filter results.
|}
|}






'''Search event implementation example'''
'''Custom event implementation example'''


     <nowiki>
     <nowiki>


         // sample search result data
         // for measuring unit selection
         var searchProperties = {
         var customEventProperties = {
             'searchString': 'BIG goats',
             'eventAction': 'click',
             'contents': [{
             'eventCategory': 'user_settings',
                'contentType': 'Product',
             'eventLabel': 'language_selection',
                'currency': 'HUF',
             'eventProperty': 'unit_format',
                'id': 'item_42',
             'eventValue': 'metric'
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 7500.0,
                'unit': 'pcs',
                'unitPrice': 2500.0,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
                {
                'contentType': 'Product',
                'currency': 'USD',
                'id': 'item_42en',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 25.935,
                'unit': 'pcs',
                'unitPrice': 8.645,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                }],
             'contentType': 'Product',
             'currency': undefined,
            'customerValue': 150.0,
             'id': 'search_01',
            'name': 'Book Search',
            'totalResults': 2
             }
             }
         }
         }
Line 2,696: Line 2,908:


         // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
         // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
         document.getElementById('search_button').addEventListener('click', function() {
         document.getElementById('set_language').addEventListener('click', function() {
             bp('track', 'search', searchProperties);
             bp('track', 'customEvent', customEventProperties);
         });
         });


         // jQuery (if you use jQuery, if in your console "$" is defined on your site)
         // jQuery (if you use jQuery, if in your console "$" is defined on your site)
         $("#search_button").click(function() {
         $("#set_language").click(function() {
             bp('track', 'search', searchProperties);
             bp('track', 'customEvent', customEventProperties);
         });
         });


     </nowiki>
     </nowiki>

Revision as of 14:40, 7 May 2019

Barion Pixel

The Barion Pixel is JavaScript code that allows you to track visitor activity on your website. It works by loading a JavaScript function which you can use whenever a site visitor takes an action that you want to track (this action is called an event).

In order to implement the Pixel, you will need:

  • access to your website's HTML code base
  • your Barion Pixel ID that you can access from your Barion Wallet

By default, the Pixel will track pages visited, and the devices your visitors use. In addition, you can use the Pixel's JavaScript function to track other events that are associated with webshop usage and e-commerce. Without collecting the consent of the website visitor you must still use the Barion Pixel on your website for fraud management purposes. (Tracking visitor behavior for the purposes of preventing fraud is considered a legitimate interest of Barion and the merchant in contract with Barion). The implementation of the base code is considered mandatory for using the Barion Smart Gateway.


Implementing the base code

Implementing the base code is not only required for you to be considered for special offers relating to the Barion Pixel, but also for using the Barion Smart Gateway at all. This is based on the fact that both Barion and you as the website owner have a legitimate interest in fraud management, and the data provided by the Barion Pixel greatly helps these efforts. This, as a legitimate interest case, is fully compliant with the GDPR, and must be implemented independently of any consent management software that your site may use.


Init (init)

  • User intent: View pages on your site
  • To be implemented at: Every page load, in the document head tag
  • Why do we need this: This provides very basic information on user sessions, and can be implemented very easily

To use the Pixel, you need to add the following code (referred to as the base code) between the opening and closing <head> tags on every page of your site. Most developers add it to their website's persistent header, so that it appears automatically on all loaded pages. Be sure to insert your unique Barion Pixel ID at both locations in the provided code example.

Placing the code within your <head> tags reduces the chances of browsers or third-party code blocking the Pixel's execution. It also executes the code sooner, increasing the chance that your visitors are tracked before they leave your page. Sending the data happens asynchronously in the client's browser so that it does not affect user experience.


Implementation of the base code

   
        <script>
            (function(i,s,o,g,r,a,m){i['BarionAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
            })(window, document, 'script', 'https://pixel.barion.com/bp.js', 'bp');

            // send page view event
            bp('init', 'addBarionPixelId', '[YOUR BARION PIXEL ID GOES HERE]');
        </script>

        <noscript>
            <img height="1" width="1" style="display:none" src="https://pixel.barion.com/a.gif?__ba_pixel_id=[YOUR BARION PIXEL ID GOES HERE]&ev=contentView&noscript=1"/>
        </noscript>
    


Heartbeat (heartbeat)

  • User intent: Browse your site
  • To be implemented at: No further implementation needed beyond the init event
  • Why do we need this: This provides information on time spent on your various pages

Heartbeat events are sent each minute from each page that the init event is implemented at, as long as the user does not navigate away from the page or the session is not considered timed out. It can provide information about time spent viewing each site by users.


Minimal implementation

To be considered for the special contract terms in connection with the implementation of the Barion Pixel's full marketing capabilities, you have to implement the following events on your site. All events should be implemented in every location applicable, further detailed below. Events may require parameters, which must be included in the bp function call as a JS object. This contains additional information about an event, for example product IDs, categories, and the number of products purchased.


Consent (grantConsent, rejectConsent)

  • User intent: Give or reject Barion Pixel consent
  • To be implemented at: Inside your own consent management software
  • Why do we need this: Participation of webshop clients is entirely consent based complying with the GDPR

Consent events determine which of the sent data can be used by us for marketing purposes. Two consent events can be used to control user consent. The "grantConsent" event has to be sent when the visitor accepts the cookie policy that expressly allows Barion to use data for marketing purposes. Sending this event must be handled by your own consent management implementation that you are responsible for as outlined in our terms. The "rejectConsent" event should be sent when the customer rejects the cookie policy that includes Barion Pixel functionality. It should be noted that rejecting Barion marketing consent does not mean that no data should be sent towards Barion, as Barion has a legitimate interest using this data for fraud management. Rejecting Barion consent however means that the data from that session will not be used for marketing purposes at all, despite receiving it. All consent events are sent by calling the Pixel's consent function as shown below.


Consent event implementation example

   
        bp('consent', 'grantConsent');
        bp('consent', 'rejectConsent');
    


Content View (contentView)

  • Firing event: Page load of item pages minimally, preferably on all pages that refers to a single item, offer or promotion
  • User intent: View the page that shows a single offer described exclusively
  • Why do we need this: Offer descriptions help us know more about your offers

This event should be fired when one of your users enters a page that refers to one of your items that can be bought, and describes it in general terms, with an offer to buy. This can be something like an offer page on an e-commerce website or a product page on a retail site. It is important to not confuse this with a full product detail page where the product itself is described in greater detail, but there is no information on price, shipping and other details that are relevant to you offer, like in the case of a product manual.


Content view event properties

key required type description
contentType YES text If this is a product page as per minimal requirements, this value should be "Product". Otherwise select a value that best fits from these: Page/Product/Article/Promotion/Banner/Misc.
currency YES (in case of "Product") text (ISO 4217) The currency that the product price is provided in, preferably in the three letter ISO 4217 format (eg. HUF, EUR).
id YES text An unique ID that you have for the offer, this can be your ID for the product, an SKU or a promotion ID.
name YES text The full name that you have for the offer, for example a product name (eg. Red Bull 24pcs carton).
quantity YES (in case of "Product") float The quantity of the product offered as initially given on the page.
unit YES (in case of "Product") text The unit that your offer is measured in (eg. pieces, kg, m).
unitPrice YES (in case of "Product") float The price of one measurement of your offer in the given currency.
brand NO text The brand of the offer.
category NO text The subcategory branch (preferred, eg. 'clothes|shoes|winter', separate levels with '|') or single category (eg. 'winter shoes' or 'summer shoes') of the offer.
contents NO array An array of JS objects for detailing multiple items of the offer. For more details see the table below.
creative NO text The name or description of the promotion, for example a promotion picture filename or slogan.
customerValue NO float A metric that you define that measures the value of the action performed to your business.
ean NO text Contains the International Article Number (EAN) of the offer if available.
list NO text The function of the loaded page from one of these possible values: HomePage/SearchPage/ProductPage/Recommendation/ComparisonPage/BasketPage/Checkout/Misc
position NO text The product's position in a list or collection (e.g. 2) or the position of the promotion on a page (e.g. banner_slot_1).
step NO integer If the page is displayed along the checkout process, the checkout step number that the page is displayed in, numbered from 0 as the checkout initiation.
variant NO text The variant of the offer from the list of possible identical items (eg. the color of a phone or the time and venue of a concert or movie)


Content view event implementation example

   

        // example properties for a product page
        var contentViewProperties = {
            'contentType': 'Product',
            'currency': 'HUF',
            'id': 'item_42',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'quantity': '10',
            'unit': 'pcs.',
            'unitPrice': 4990.0,
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': undefined,
            'creative': undefined,
            'customerValue': '150',
            'ean': 9780575115347,
            'list': 'ProductPage',
            'position': undefined,
            'step': undefined,
            'variant': 'hardcover'
        }

        // example properties on a home page for a promotion of a product
        var contentViewProperties = {
            'contentType': 'Promotion',
            'currency': 'HUF',
            'id': 'item_42',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'quantity': '10',
            'unit': 'pcs.',
            'unitPrice': 4990.0,
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': undefined,
            'creative': 'book_promo_02',
            'customerValue': '150',
            'ean': 9780575115347,
            'list': 'HomePage',
            'position': 2,
            'step': undefined,
            'variant': 'hardcover'
        }

        // example properties on a checkout page for a promotion of a product
        var contentViewProperties = {
            'contentType': 'Promotion',
            'currency': 'HUF',
            'id': 'item_42',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'quantity': '10',
            'unit': 'pcs.',
            'unitPrice': 4990.0,
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': undefined,
            'creative': 'also_bought_05',
            'customerValue': '150',
            'ean': 9780575115347,
            'list': 'Checkout',
            'position': 5,
            'step': 2,
            'variant': 'hardcover'
        }


        bp('track', 'contentView', contentViewProperties);

    


Add to Cart (addToCart)

  • Firing event: Button click that results in a product to be selected for purchase
  • User intent: Select product for purchase
  • Why do we need this: Users demonstrate strong interest in your items by selecting them for purchase

The add to cart event is, as its name suggests, connected to a user "adding a product to their cart". Usually this means that a user decide to purchase a product or service, and has added this item to their cart. Even if your website does not use carts in the literal sense, there is a point in a user session where the given user decides that they intend to purchase the product. This exact intent is what we want to capture here, so the button click which best matches the point of this intent, such as one labeled 'Buy' or 'Reserve' should be the one to attach this event to.


Add to cart event properties

key required type description
contentType YES text Usually, this value should be "Product".
currency YES text (ISO 4217) The currency that the price is provided in, preferably in the three letter ISO 4217 format (eg. HUF, EUR).
id YES text An unique ID that you have for the item, this can be your ID for the product, an SKU or a promotion ID.
name YES text The full name that you have for the added item, for example a product name (eg. Red Bull 24pcs carton).
quantity YES float The quantity of the item added to the cart.
totalItemPrice YES float The total price of the added items in the given currency.
unit YES text The unit that your item is measured in (eg. pieces, kg, hours).
unitPrice YES float The price of one measurement of your item in the given currency.
brand NO text The brand of the item.
category NO text The subcategory branch (preferred, eg. 'clothes|shoes|winter', separate levels with '|') or single category (eg. 'winter shoes' or 'summer shoes') of the item.
contents NO array An array of JS objects for detailing multiple items of the item. For more details see the table below.
coupon NO text The coupon code that was used when the item was added to cart.
creative NO text The name or description of the promotion for the item, for example a promotion picture filename or slogan of the promotion that adds the items to the cart automatically.
customerValue NO float A metric that you define that measures the value of the action performed to your business.
ean NO text Contains the International Article Number (EAN) of the offer if available.
list NO text The function of the loaded page from one of these possible values: HomePage/SearchPage/ProductPage/Recommendation/ComparisonPage/BasketPage/Checkout/Misc
position NO text The item's position in a list or collection (e.g. 2) or the position of the promotion on a page (e.g. banner_slot_1).
step NO integer If the page is displayed along the checkout process, the checkout step number that the page is displayed in, numbered from 0 as the checkout initiation.
variant NO text The variant of the offer from the list of possible identical items (eg. the color of a phone or the time and venue of a concert or movie)


Add to cart event implementation example

   

        // sample product data for single items
        var addToCartProperties = {
            'contentType': 'Product',
            'currency': 'HUF',
            'id': 'item_42',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'quantity': '10',
            'totalItemPrice': 49900.0,
            'unit': 'pcs.',
            'unitPrice': 4990.0,
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': undefined,
            'coupon': '43763436874'
            'creative': 'product_page_promo_42',
            'customerValue': '150',
            'ean': 9780575115347,
            'list': 'ProductPage',
            'position': 3,
            'step': 2,
            'variant': 'hardcover'
        }

        // sample product data for bundled items
        var addToCartProperties = {
            'contentType': 'Product',
            'currency': 'HUF',
            'id': 'item_42pack',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'quantity': '10',
            'totalItemPrice': 150000.0,
            'unit': 'pcs.',
            'unitPrice': 15000.0,
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': [{
                'contentType': 'Product',
                'currency': 'HUF',
                'id': 'item_42',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 7500.0,
                'unit': 'pcs',
                'unitPrice': 2500.0,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
                {
                'contentType': 'Product',
                'currency': 'USD',
                'id': 'item_42en',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 25.935,
                'unit': 'pcs',
                'unitPrice': 8.645,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
            'coupon': '43763436874'
            'creative': 'add_to_cart_promo_42',
            'customerValue': '150',
            'ean': 9780575115347,
            'list': 'BasketPage',
            'position': 3,
            'step': undefined,
            'variant': 'hardcover'
        }

        // Use one of these to add the event listener to the button click (use only one):

        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('addtocart_button').addEventListener('click', function() {
            bp('track', 'addToCart', addToCartProperties);
        });

        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("#addtocart_button").click(function() {
            bp('track', 'addToCart', addToCartProperties);
        });

    


Initiate Checkout (initiateCheckout)

  • Firing event: Button click that starts the checkout process
  • User intent: Purchase the items in the cart
  • Why do we need this: Users usually are put off by adverts of an item they already purchased, but can be receptive to related products

Usually on a webshop, there is a checkout process that starts with clicking a button with items in your cart. This button click is the one that this event should be attached to. After this click, typically the user has to provide other data, such as a shipping address and method, and confirm the purchase (which should fire the initiate purchase event).


Initiate checkout event properties

key required type description
contents YES array An array of JS objects for detailing the actual items contained in the cart, meaning the shipping and coupons should be excluded. For the detailed format see the table below.
currency YES text (ISO 4217) The currency that the price is provided in, preferably in the three letter ISO 4217 format (eg. HUF, EUR).
revenue YES float The total revenue associated with the transaction in the given currency. This should include all costs the customer pays like shipping or tax.
step YES integer In most cases, since this is the first checkout step, this should be 0.
contentType NO text Usually this value should be "Product".
coupon NO text The coupon code that is being used.
creative NO text The name or description of the promotion for the cart, for example a promotion picture filename or slogan of the promotion that starts the checkout automatically.
customerValue NO float A metric that you define that measures the value of the action performed to your business.
list NO text In most cases this should be 'Checkout'.
option NO text Additional information about the purchase.
orderNumber NO text The unique ID of the purchase.
position NO text The item's position in a list or collection (e.g. 2) or the position of the promotion on a page (e.g. banner_slot_1).
shipping NO float The price of shipping associated with the purchase in the given currency.
shippingAddress NO object The shipping address given in the format detailed below.
tax NO float The tax associated with the purchase in the given currency.


Initiate checkout event implementation example

   

        // sample product data
        var initiateCheckoutProperties = {
            'contents': [{
                'contentType': 'Product',
                'currency': 'HUF',
                'id': 'item_42',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 7500.0,
                'unit': 'pcs',
                'unitPrice': 2500.0,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
                {
                'contentType': 'Product',
                'currency': 'USD',
                'id': 'item_42en',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 25.935,
                'unit': 'pcs',
                'unitPrice': 8.645,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
            ]
            'currency': 'HUF',
            'revenue': 17500.0,
            'step': 0,
            'contentType': 'Product',
            'coupon': '43763436874'
            'creative': 'preselected_cart_01',
            'customerValue': '150',
            'list': 'Checkout',
            'option': 'To postal office, no street address',
            'orderNumber': 852,
            'position': 1,
            'shipping': 2500.0,
            'shippingAddress': {
                'city': 'Budapest',
                'country': 'HU',
                'deliveryMethod': 'DHL',
                'fullName': 'John Doe',
                'phone': '+36 1 1111 111',
                'region': 'HU-BU',
                'street': 'Műegyetem rkpt. 3.',
                'street2': '2. porta',
                'zip': '1111'
            },
            'tax': '0.0'
        }

        // Use one of these to add the event listener to the button click (use only one):

        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('checkout_button').addEventListener('click', function() {
            bp('track', 'initiateCheckout', initiateCheckoutProperties);
        });

        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("#checkout_button").click(function() {
            bp('track', 'initiateCheckout', initiateCheckoutProperties);
        });

    


Initiate Purchase (initiatePurchase)

  • Firing event: Button click that completes the checkout process
  • User intent: Pay for the items in the cart
  • Why do we need this: Users usually are put off by adverts of an item they already purchased, but can be receptive to related products

This event should be fired at the same time as the user is redirected to a payment solution's own website, for example when the user is sent to the Barion Smart Gateway for payment. It should also be fired if the user chose a non-payment checkout option, for example payment on receipt, but the transaction is considered complete. This should be the last confirmation of the checkout process, after which the sale is considered to have taken place. Ideally after pressing this button the user should reach either a 'payment pending' then a 'thank you' page, or simply the 'thank you' page.


Initiate purchase event properties

key required type description
contents YES array An array of JS objects for detailing the actual items contained in the cart, meaning the shipping and coupons should be excluded. For the detailed format see the table below.
currency NO text (ISO 4217) The currency that the price is provided in, preferably in the three letter ISO 4217 format (eg. HUF, EUR).
revenue NO float The total revenue associated with the transaction in the given currency. This should include all costs the customer pays like shipping or tax.
step YES integer In most cases, since this is the first checkout step, this should be 0.
contentType NO text Usually this value should be "Product".
coupon NO text The coupon code that is being used.
creative NO text The name or description of the promotion for the cart, for example a promotion picture filename or slogan of the promotion that starts the checkout automatically.
customerValue NO float A metric that you define that measures the value of the action performed to your business.
list NO text In most cases this should be 'Checkout'.
option NO text Additional information about the purchase.
orderNumber NO text The unique ID of the purchase.
position NO text The item's position in a list or collection (e.g. 2) or the position of the promotion on a page (e.g. banner_slot_1).
shipping NO float The price of shipping associated with the purchase in the given currency.
shippingAddress NO object The shipping address given in the format detailed below.
tax NO float The tax associated with the purchase in the given currency.


Initiate purchase event implementation example

   

        // sample product data
        var initiatePurchaseProperties = {
            'contents': [{
                'contentType': 'Product',
                'currency': 'HUF',
                'id': 'item_42',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 7500.0,
                'unit': 'pcs',
                'unitPrice': 2500.0,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
                {
                'contentType': 'Product',
                'currency': 'USD',
                'id': 'item_42en',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 25.935,
                'unit': 'pcs',
                'unitPrice': 8.645,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
            ]
            'currency': 'HUF',
            'revenue': 17500.0,
            'step': 6,
            'contentType': 'Product',
            'coupon': '43763436874'
            'creative': 'preselected_cart_01',
            'customerValue': '150',
            'list': 'Checkout',
            'option': 'To postal office, no street address',
            'orderNumber': 852,
            'position': 1,
            'shipping': 2500.0,
            'shippingAddress': {
                'city': 'Budapest',
                'country': 'HU',
                'deliveryMethod': 'DHL',
                'fullName': 'John Doe',
                'phone': '+36 1 1111 111',
                'region': 'HU-BU',
                'street': 'Műegyetem rkpt. 3.',
                'street2': '2. porta',
                'zip': '1111'
            },
            'tax': '0.0'
        }

        // Use one of these to add the event listener to the button click (use only one):

        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('confirm_payment').addEventListener('click', function() {
            bp('track', 'initiatePurchase', initiatePurchaseProperties);
        });

        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("#confirm_payment").click(function() {
            bp('track', 'initiatePurchase', initiatePurchaseProperties);
        });

    


Full implementation

This is the list of all events that are supported by Barion Pixel. Implementing these is currently not normally part of contract terms, but supplying these will improve our service to your site, as we will receive more and better data about your users. This will improve our capability to provide our services, especially in connection to your market and your users.


Set User Properties (setUserProperties)

  • Firing event: Button click when user properties are available
  • User intent: Provide personal details
  • Why do we need this: Information about users helps us give more relevant offers to them

This event should be attached to any browser event that when fired, can access user information. We handle all user information in accordance with the GDPR and as such, all personally identifying information is hashed directly on the client side, in the JS code, before being forwarded to us, which makes it impossible to read it on our side. This makes it very important to fill out the properties provided below correctly, so that all PII falls in the correct fields that will be hashed before sending. The pages that this event can be inserted into are mostly sign up or sign in pages, newsletter subscription pages, and any other page where the user can provide information about themselves. This event can also be sent during the checkout process.


Set user properties event properties

key required hashed type description
userId YES YES text Your ID for the user, for example an username, email or internal ID that you identify the user with on your site.
accountCreatedTime NO NO UNIX timestamp The time that the user account had been created, in a UNIX timestamp that is seconds accurate.
age NO NO text The age of the user.
city NO NO text The city that the user lives in.
country NO NO text The country that the user lives in, preferably in the ISO 3166-1 alpha-2 format, eg. HU or CZ.
county NO NO text The county that the user lives in, preferably in the ISO 3166-2 format, eg. HU-BU.
currency NO NO text Currency that the user prefers, or the one that the prices are displayed to them in. 3 digit ISO 4217 format is preferred (eg. HUF, EUR).
email NO YES text The email that belongs to the user.
gender NO NO text The gender of the user.
interests NO NO text The interests of the user, separated with the pipe character, eg. "Arts|Games".
language NO NO text The language of the user, preferably in the ISO 639-1 format, eg. hu or cz.
phone NO YES text Phone number of the user, preferably in the E.164 format, eg. +36 1 111 1111
shippingAddress NO NO object The address of the user in the format described below.
step NO NO text If the user properties are set in the checkout process, the checkout process step.
zipCode NO NO text The ZIP code


Set user properties event implementation example

   

        // sample user data
        var clickProductProperties = {
            'userId': 'user_42',
            'accountCreatedTime': 1557223622,
            'age': '12-24',
            'city': 'Budapest',
            'country': 'HU',
            'county': 'HU-BU',
            'currency': 'HUF',
            'email': '[email protected]',
            'gender': 'male',
            'interests': 'Arts|Crafts',
            'language': 'hu',
            'phone': '+36 1 111 1111',
            'shippingAddress': {
                'city': 'Budapest',
                'country': 'HU',
                'deliveryMethod': 'DHL',
                'fullName': 'John Doe',
                'phone': '+36 1 1111 111',
                'region': 'HU-BU',
                'street': 'Műegyetem rkpt. 3.',
                'street2': '2. porta',
                'zip': '1111'
            }
            'step': 1,
            'zipCode': '1111'
        }


        // Use one of these to add the event listener to the button click (use only one):

        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('next').addEventListener('click', function() {
            bp('track', 'setUserProperties', setUserPropertiesProperties);
        });

        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("#next").click(function() {
            bp('track', 'setUserProperties', setUserPropertiesProperties);
        });

    


Category Selection (categorySelection)

  • Firing event: Button click on a category on a category selection page
  • User intent: View a category
  • Why do we need this: Users demonstrate interest in items belonging to a category by looking at the category

This event should be implemented where the user can select a category of events on a page, for example a brand, a common property, a theme, a price range or any grouping of product along something that makes them belong to the category.


Category selection event properties

key required type description
id YES text Unique ID of the category clicked on your site.
name YES text Full name of the category.
brand NO text Brand of the item in the category clicked.
category NO text The category (eg. 'winter shoes' or 'summer shoes') or subcategory branch (eg. 'clothes|shoes|winter' or 'clothes|shoes|summer', separate levels with '|') of the category that was clicked.
contents NO array An array of JS objects for detailing items in the category. For more details see the table below.
contentType NO text Usually this value should be "Page".
customerValue NO float The value of a user performing this event to the business.
list NO text The collection that the category clicked is in from one of these possible values: HomePage/SearchPage/ProductPage/Recommendation/ComparisonPage/BasketPage/Checkout/Misc
position NO text The category's position in the list or collection (e.g. 2) or the position of the creative (e.g. banner_slot_1)
step NO integer A number that represents the progress in the checkout process.


Category selection event implementation example

   

        // sample category data
        var categorySelectionProperties = {
            'id': 'books_scifi',
            'name': 'Sci-Fi Books',
            'brand': undefined,
            'category': 'Books',
            'contents': undefined,
            'contentType': 'Page',
            'customerValue': 150,
            'list': 'SearchPage',
            'position': 42,
            'step': undefined
        }

        // Use one of these to add the event listener to the button click (use only one):

        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('select_category').addEventListener('click', function() {
            bp('track', 'categorySelection', categorySelectionProperties);
        });

        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("#select_category").click(function() {
            bp('track', 'categorySelection', categorySelectionProperties);
        });

    


Click Product (clickProduct)

  • Firing event: Button click on an item
  • User intent: View an item
  • Why do we need this: Users demonstrate interest in your items by clicking them

This event should be fired each time when a user selects any of your items. This could be for example on a product selection page, a result on a search or filter page, an item on a promotion. The page type on which the button is on should be specified in the 'list' property. In case of product bundles, you can use the 'contents' property to list each item in the bundle, while the direct properties should refer to the bundle as a whole as an item.



Click product event properties

key required type description
contentType YES text The type of the content of the page where the item was selected. Possible values (only these are accepted): Page/Product/Article/Promotion/Banner/Misc.
currency YES text (ISO 4217) Currency that the item is listed in for purchase. 3 digit ISO 4217 format is preferred (eg. HUF, EUR).
id YES text Unique ID of the item clicked on your site.
name YES text Full name of the item clicked.
quantity YES integer The quantity of a product clicked measured in the unit provided (e.g. 2).
unit YES text The measurement unit of the item clicked. (e.g. pcs, kg).
unitPrice YES float Price of one unit (that you provided) of the item clicked (in the currency that you provided).
brand NO text Brand of the item clicked.
category NO text shoes|winter' or 'clothes|shoes|summer', separate levels with '|') of the item clicked.
contents NO array An array of JS objects for detailing multiple items clicked. For more details see the table below.
creative NO text The name or description of the promotion for the item, for example a promotion picture filename or slogan of the promotion that selects the item.
customerValue NO float The value of a user performing this event to the business.
ean NO text Contains the International Article Number (EAN) of the item if available.
list NO text The collection that the product clicked is in from one of these possible values: HomePage/SearchPage/ProductPage/Recommendation/ComparisonPage/BasketPage/Checkout/Misc
position NO text The product's position in the list or collection (e.g. 2) or the position of the creative (e.g. banner_slot_1)
step NO integer A number that represents the progress in the checkout process. Usually at a click product event, this is 0.
variant NO text The variant of the product (e.g. 'black') clicked.


Click product event implementation example

   

        // sample product data for single product
        var clickProductProperties = {
            'contentType': 'Product',
            'currency': 'HUF',
            'id': 'item_42',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'quantity': 1,
            'unit': 'pcs',
            'unitPrice': 2500.0,
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': undefined,
            'creative': 'book_42',
            'customerValue': '150.0',
            'ean': 9780575115347,
            'list': 'Checkout',
            'position': 1,
            'step': 2,
            'variant': 'hardcover'
        }


        // sample product data for bundle offer
        var clickProductProperties = {
            'contentType': 'Product',
            'currency': 'HUF',
            'id': 'item_42pack',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'quantity': 1,
            'unit': 'pcs',
            'unitPrice': 15000.0,
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': [{
                'contentType': 'Product',
                'currency': 'HUF',
                'id': 'item_42',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 7500.0,
                'unit': 'pcs',
                'unitPrice': 2500.0,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
                {
                'contentType': 'Product',
                'currency': 'USD',
                'id': 'item_42en',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 25.935,
                'unit': 'pcs',
                'unitPrice': 8.645,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
            ]
            'creative': 'bundle_offer_01',
            'customerValue': '150.0',
            'ean': 9780575115347,
            'list': 'Checkout',
            'position': 1,
            'step': 2,
            'variant': 'hardcover'
        }

        // Use one of these to add the event listener to the button click (use only one):

        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('book_42').addEventListener('click', function() {
            bp('track', 'clickProduct', clickProductProperties);
        });

        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("#book_42").click(function() {
            bp('track', 'clickProduct', clickProductProperties);
        });

    


Click Product Detail (clickProductDetail)

  • Firing event: Button click requesting extended details about an item
  • User intent: View extended information about an item
  • Why do we need this: Users demonstrate high interest in your items by looking up details about them

This event should fire on a button click that can be either a webpage or an asynchronous request for more details about an item. It should be implemented at any button that results in more details being shown about an item.


Click product detail event properties

key required type description
contentType YES text The type of the content of the page where the item was selected. Possible values (only these are accepted): Page/Product/Article/Promotion/Banner/Misc.
currency YES text (ISO 4217) Currency that the item is listed in for purchase. 3 digit ISO 4217 format is preferred (eg. HUF, EUR).
id YES text Unique ID of the item clicked on your site.
name YES text Full name of the item clicked.
unit YES text The measurement unit of the item clicked. (e.g. pcs, kg).
unitPrice YES float Price of one unit (that you provided) of the item clicked (in the currency that you provided).
variant NO text The variant of the product (e.g. 'black') clicked.
brand NO text Brand of the item clicked.
category NO text shoes|winter' or 'clothes|shoes|summer', separate levels with '|') of the item clicked.
contents NO array An array of JS objects for detailing multiple items clicked. For more details see the table below.
creative NO text The name or description of the promotion for the item, for example a promotion picture filename or slogan of the promotion that selects the item.
customerValue NO float The value of a user performing this event to the business.
ean NO text Contains the International Article Number (EAN) of the item if available.
list NO text The collection that the product clicked is in from one of these possible values: HomePage/SearchPage/ProductPage/Recommendation/ComparisonPage/BasketPage/Checkout/Misc
position NO text The product's position in the list or collection (e.g. 2) or the position of the creative (e.g. banner_slot_1)
step NO integer A number that represents the progress in the checkout process. Usually at a click product event, this is 0.
quantity NO integer The quantity of a product clicked measured in the unit provided (e.g. 2).
variant NO text The variant of the product (e.g. 'black') clicked.


Click product event implementation example

   

        // sample product data for single product
        var clickProductDetailProperties = {
            'contentType': 'Product',
            'currency': 'HUF',
            'id': 'item_42',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'unit': 'pcs',
            'unitPrice': 2500.0,
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': undefined,
            'creative': 'book_42',
            'customerValue': '150.0',
            'ean': 9780575115347,
            'list': 'Checkout',
            'position': 1,
            'step': 2,
            'quantity': 1,
            'variant': 'hardcover'
        }


        // sample product data for bundle offer
        var clickProductDetailProperties = {
            'contentType': 'Product',
            'currency': 'HUF',
            'id': 'item_42pack',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'unit': 'pcs',
            'unitPrice': 15000.0,
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': [{
                'contentType': 'Product',
                'currency': 'HUF',
                'id': 'item_42',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 7500.0,
                'unit': 'pcs',
                'unitPrice': 2500.0,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
                {
                'contentType': 'Product',
                'currency': 'USD',
                'id': 'item_42en',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 25.935,
                'unit': 'pcs',
                'unitPrice': 8.645,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
            ]
            'creative': 'bundle_offer_01',
            'customerValue': '150.0',
            'ean': 9780575115347,
            'list': 'Checkout',
            'position': 1,
            'step': 2,
            'quantity': 1,
            'variant': 'hardcover'
        }

        // Use one of these to add the event listener to the button click (use only one):

        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('more_details').addEventListener('click', function() {
            bp('track', 'clickProductDetail', clickProductDetailProperties);
        });

        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("#more_details").click(function() {
            bp('track', 'clickProductDetail', clickProductDetailProperties);
        });

    


Customize Product (customizeProduct)

  • Firing event: Button click changing particular characteristics of an item
  • User intent: Change characteristics of an item
  • Why do we need this: Users demonstrate interest in your items by customizing them

This event should fire on a button click that can be either a webpage or an asynchronous request for a different variant of an item, for example color, size etc. It should be implemented at any button that results in a different variant being shown.


Customize product event properties

key required type description
contentType YES text The type of the content of the page where the item was selected. Possible values (only these are accepted): Page/Product/Article/Promotion/Banner/Misc.
currency YES text (ISO 4217) Currency that the item is listed in for purchase. 3 digit ISO 4217 format is preferred (eg. HUF, EUR).
id YES text Unique ID of the item clicked on your site.
name YES text Full name of the item clicked.
unit YES text The measurement unit of the item clicked. (e.g. pcs, kg).
unitPrice YES float Price of one unit (that you provided) of the item clicked (in the currency that you provided).
variant YES text The variant of the product (e.g. 'black') clicked.
brand NO text Brand of the item clicked.
category NO text shoes|winter' or 'clothes|shoes|summer', separate levels with '|') of the item clicked.
contents NO array An array of JS objects for detailing multiple items clicked. For more details see the table below.
creative NO text The name or description of the promotion for the item, for example a promotion picture filename or slogan of the promotion that selects the item.
customerValue NO float The value of a user performing this event to the business.
ean NO text Contains the International Article Number (EAN) of the item if available.
list NO text The collection that the product clicked is in from one of these possible values: HomePage/SearchPage/ProductPage/Recommendation/ComparisonPage/BasketPage/Checkout/Misc
position NO text The product's position in the list or collection (e.g. 2) or the position of the creative (e.g. banner_slot_1)
quantity NO integer The quantity of a product clicked measured in the unit provided (e.g. 2).
step NO integer A number that represents the progress in the checkout process. Usually at a click product event, this is 0.


Customize product event implementation example

   

        // sample product data for single product
        var customizeProductProperties = {
            'contentType': 'Product',
            'currency': 'HUF',
            'id': 'item_42',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'unit': 'pcs',
            'unitPrice': 2500.0,
            'variant': 'hardcover'
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': undefined,
            'creative': 'book_42',
            'customerValue': '150.0',
            'ean': 9780575115347,
            'list': 'Checkout',
            'position': 1,
            'step': 2,
            'quantity': 1,
        }


        // sample product data for bundle offer
        var customizeProductProperties = {
            'contentType': 'Product',
            'currency': 'HUF',
            'id': 'item_42pack',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'unit': 'pcs',
            'unitPrice': 15000.0,
            'variant': 'hardcover'
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': [{
                'contentType': 'Product',
                'currency': 'HUF',
                'id': 'item_42',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 7500.0,
                'unit': 'pcs',
                'unitPrice': 2500.0,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
                {
                'contentType': 'Product',
                'currency': 'USD',
                'id': 'item_42en',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 25.935,
                'unit': 'pcs',
                'unitPrice': 8.645,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
            ]
            'creative': 'bundle_offer_01',
            'customerValue': '150.0',
            'ean': 9780575115347,
            'list': 'Checkout',
            'position': 1,
            'step': 2,
            'quantity': 1,
        }

        // Use one of these to add the event listener to the button click (use only one):

        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('customize').addEventListener('click', function() {
            bp('track', 'customizeProduct', customizeProductProperties);
        });

        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("#customize").click(function() {
            bp('track', 'customizeProduct', customizeProductProperties);
        });

    


Purchase (purchase)

  • Firing event: Page load after the payment process
  • User intent: Verify the completion of the transaction
  • Why do we need this: Users usually are put off by adverts of an item they already purchased, but can be receptive to related products

This event should be fired on the page load where the user is notified about the completion of their transaction. This is usually a 'thank you' page, that thanks the user for their purchase and verifies that the payment was successful. If the payment wasn't successful, then still this is the event that needs to be fire, except the 'step' property should be given a '-1' value.


Purchase event properties

key required type description
contents YES array An array of JS objects for detailing the actual items contained in the cart, meaning the shipping and coupons should be excluded. For the detailed format see the table below.
currency NO text (ISO 4217) The currency that the price is provided in, preferably in the three letter ISO 4217 format (eg. HUF, EUR).
revenue NO float The total revenue associated with the transaction in the given currency. This should include all costs the customer pays like shipping or tax.
step YES integer In most cases, since this is after the last checkout step, this should be the maximum value that you use. If the transaction is unsuccessful, this should be -1.
contentType NO text Usually this value should be "Product".
coupon NO text The coupon code that is being used.
creative NO text The name or description of the promotion for the cart, for example a promotion picture filename or slogan of the promotion that starts the checkout automatically.
customerValue NO float A metric that you define that measures the value of the action performed to your business.
list NO text In most cases this should be 'Checkout'.
option NO text Additional information about the purchase.
orderNumber NO text The unique ID of the purchase.
position NO text The item's position in a list or collection (e.g. 2) or the position of the promotion on a page (e.g. banner_slot_1).
shipping NO float The price of shipping associated with the purchase in the given currency.
shippingAddress NO object The shipping address given in the format detailed below.
tax NO float The tax associated with the purchase in the given currency.


Successful purchase event implementation example

   

        var purchaseProperties = {
            'contents': [{
                'contentType': 'Product',
                'currency': 'HUF',
                'id': 'item_42',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 7500.0,
                'unit': 'pcs',
                'unitPrice': 2500.0,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
                {
                'contentType': 'Product',
                'currency': 'USD',
                'id': 'item_42en',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 25.935,
                'unit': 'pcs',
                'unitPrice': 8.645,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
            ]
            'currency': 'HUF',
            'revenue': 17500.0,
            'step': 7,
            'contentType': 'Product',
            'coupon': '43763436874'
            'creative': 'preselected_cart_01',
            'customerValue': '150',
            'list': 'Checkout',
            'option': 'To postal office, no street address',
            'orderNumber': 852,
            'position': 1,
            'shipping': 2500.0,
            'shippingAddress': {
                'city': 'Budapest',
                'country': 'HU',
                'deliveryMethod': 'DHL',
                'fullName': 'John Doe',
                'phone': '+36 1 1111 111',
                'region': 'HU-BU',
                'street': 'Műegyetem rkpt. 3.',
                'street2': '2. porta',
                'zip': '1111'
            },
            'tax': '0.0'
        }

        bp('track', 'purchase', purchaseProperties);

    


Remove from Cart (removeFromCart)

  • Firing event: Button click that results in a product to be removed from the items selected for purchase
  • User intent: Deselect product for purchase
  • Why do we need this: Users demonstrate interest in carted products, and this can be refined if we know when products are deselected

The remove from cart event is very similar to the add to cart event, and is mainly required to refine our data on selected items by informing us when products are taken out from the cart or deselected from purchase. It can also mean that a purchase process that first made a user select an item is simply cancelled.


Remove from cart event properties

key required type description
contentType YES text Usually, this value should be "Product".
currency YES text (ISO 4217) The currency that the price is provided in, preferably in the three letter ISO 4217 format (eg. HUF, EUR).
id YES text An unique ID that you have for the item, this can be your ID for the product, an SKU or a promotion ID.
name YES text The full name that you have for the added item, for example a product name (eg. Red Bull 24pcs carton).
quantity YES float The quantity of the item removed from the cart.
totalItemPrice YES float The total price of the removed items in the given currency.
unit YES text The unit that your item is measured in (eg. pieces, kg, hours).
unitPrice YES float The price of one measurement of your item in the given currency.
brand NO text The brand of the item.
category NO text The subcategory branch (preferred, eg. 'clothes|shoes|winter', separate levels with '|') or single category (eg. 'winter shoes' or 'summer shoes') of the item.
contents NO array An array of JS objects for detailing multiple items of the item. For more details see the table below.
coupon NO text The coupon code that was used when the item was removed from cart.
creative NO text Seldom used, for example a promotion that changes a product in your cart to a better, more expensive or more recent one.
customerValue NO float A metric that you define that measures the value of the action performed to your business.
ean NO text Contains the International Article Number (EAN) of the item if available.
list NO text The function of the loaded page from one of these possible values: HomePage/SearchPage/ProductPage/Recommendation/ComparisonPage/BasketPage/Checkout/Misc
position NO text The item's position in a list or collection (e.g. 2) or the position of the promotion on a page (e.g. banner_slot_1).
step NO integer If the page is displayed along the checkout process, the checkout step number that the page is displayed in, numbered from 0 as the checkout initiation.
variant NO text The variant of the offer from the list of possible identical items (eg. the color of a phone or the time and venue of a concert or movie)


Remove from cart event implementation example

   

        // sample product data for single items
        var removeFromCartProperties = {
            'contentType': 'Product',
            'currency': 'HUF',
            'id': 'item_42',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'quantity': '10',
            'totalItemPrice': 49900.0,
            'unit': 'pcs.',
            'unitPrice': 4990.0,
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': undefined,
            'coupon': '43763436874'
            'creative': 'upsell_promo_42',
            'customerValue': '150',
            'ean': 9780575115347,
            'list': 'BasketPage',
            'position': 3,
            'step': 2,
            'variant': 'hardcover'
        }

        // sample product data for bundled items
        var removeFromCartProperties = {
            'contentType': 'Product',
            'currency': 'HUF',
            'id': 'item_42pack',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'quantity': '10',
            'totalItemPrice': 150000.0,
            'unit': 'pcs.',
            'unitPrice': 15000.0,
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': [{
                'contentType': 'Product',
                'currency': 'HUF',
                'id': 'item_42',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 7500.0,
                'unit': 'pcs',
                'unitPrice': 2500.0,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
                {
                'contentType': 'Product',
                'currency': 'USD',
                'id': 'item_42en',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 25.935,
                'unit': 'pcs',
                'unitPrice': 8.645,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
            'coupon': '43763436874'
            'creative': 'upsell_promo_42',
            'customerValue': '150',
            'ean': 9780575115347,
            'list': 'BasketPage',
            'position': 3,
            'step': undefined,
            'variant': 'hardcover'
        }

        // Use one of these to add the event listener to the button click (use only one):

        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('remove_button').addEventListener('click', function() {
            bp('track', 'removeFromCart', removeFromCartProperties);
        });

        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("#remove_button").click(function() {
            bp('track', 'removeFromCart', removeFromCartProperties);
        });

    


Add Payment Info (addPaymentInfo)

  • Firing event: Button click at a point in the checkout process where the payment method is already set
  • User intent: Select payment method
  • Why do we need this: It helps to identify user financial habits

This event should be fired when the payment method of a user is already entered. This event should be fired both if the payment info is explicitly requested and provided, but also if it is only implied for example when only one option is available.


Add payment info event properties

key required type description
contents YES array An array of JS objects for detailing the actual items contained in the cart, meaning the shipping and coupons should be excluded. For the detailed format see the table below.
currency YES text (ISO 4217) The currency that the price is provided in, preferably in the three letter ISO 4217 format (eg. HUF, EUR).
paymentMethod YES text The method of payment that the user chooses, for example Barion, cash etc.
revenue YES float The total revenue associated with the transaction in the given currency. This should include all costs the customer pays like shipping or tax.
step YES integer In most cases, since this is the first checkout step, this should be 0.
contentType NO text Usually this value should be "Product".
coupon NO text The coupon code that is being used.
creative NO text The name or description of the promotion for the cart, for example a promotion picture filename or slogan of the promotion that starts the checkout automatically.
customerValue NO float A metric that you define that measures the value of the action performed to your business.
list NO text In most cases this should be 'Checkout'.
option NO text Additional information about the purchase.
orderNumber NO text The unique ID of the purchase.
position NO text The item's position in a list or collection (e.g. 2) or the position of the promotion on a page (e.g. banner_slot_1).
shipping NO float The price of shipping associated with the purchase in the given currency.
shippingAddress NO object The shipping address given in the format detailed below.
tax NO float The tax associated with the purchase in the given currency.


Add payment info event implementation example

   

        // sample product data
        var addPaymentInfoProperties = {
            'contents': [{
                'contentType': 'Product',
                'currency': 'HUF',
                'id': 'item_42',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 7500.0,
                'unit': 'pcs',
                'unitPrice': 2500.0,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
                {
                'contentType': 'Product',
                'currency': 'USD',
                'id': 'item_42en',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 25.935,
                'unit': 'pcs',
                'unitPrice': 8.645,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
            ]
            'currency': 'HUF',
            'paymentMethod': 'Barion'
            'revenue': 17500.0,
            'step': 0,
            'contentType': 'Product',
            'coupon': '43763436874'
            'creative': 'preselected_cart_01',
            'customerValue': '150',
            'list': 'Checkout',
            'option': 'To postal office, no street address',
            'orderNumber': 852,
            'position': 1,
            'shipping': 2500.0,
            'shippingAddress': {
                'city': 'Budapest',
                'country': 'HU',
                'deliveryMethod': 'DHL',
                'fullName': 'John Doe',
                'phone': '+36 1 1111 111',
                'region': 'HU-BU',
                'street': 'Műegyetem rkpt. 3.',
                'street2': '2. porta',
                'zip': '1111'
            },
            'tax': '0.0'
        }

        // Use one of these to add the event listener to the button click (use only one):

        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('checkout_next').addEventListener('click', function() {
            bp('track', 'addPaymentInfo', addPaymentInfoProperties);
        });

        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("#checkout_next").click(function() {
            bp('track', 'addPaymentInfo', addPaymentInfoProperties);
        });

    


Click Promo (clickPromo)

  • Firing event: Button click on a promotion box
  • User intent: View a promotion
  • Why do we need this: Users demonstrate interest in your promotion offers by clicking them

This event should be fired when one of your users selects a promotion. Promotions can be usually placed on home pages, product places, in the checkout process and many other places. The promotion can be about a product, offer, brand or any other single offer or grouping of offers.


Click product event properties

key required type description
contentType YES text The type of the content of the page where the promotion was selected. Possible values (only these are accepted): Page/Product/Article/Promotion/Banner/Misc.
creative YES text The name or description of the promotion, for example a promotion picture filename or slogan of the promotion.
id YES text Unique ID of the promotion clicked on your site.
name YES text Full name of the promotion.
brand NO text Brand of the item in the promotion clicked.
category NO text The category (eg. 'winter shoes' or 'summer shoes') or subcategory branch (eg. 'clothes|shoes|winter' or 'clothes|shoes|summer', separate levels with '|') of the item in the promotion clicked.
contents NO array An array of JS objects for detailing multiple items promoted. For more details see the table below.
currency NO text (ISO 4217) Currency that the promoted offer is listed in. 3 digit ISO 4217 format is preferred (eg. HUF, EUR).
customerValue NO float The value of a user performing this event to the business.
ean NO text Contains the International Article Number (EAN) of the item if available.
list NO text The collection that the promotion clicked is in from one of these possible values: HomePage/SearchPage/ProductPage/Recommendation/ComparisonPage/BasketPage/Checkout/Misc
position NO text The promotion's position in the list or collection (e.g. 2) or the position of the creative (e.g. banner_slot_1)
quantity NO integer The quantity that the item is promoted in, measured in the unit provided (e.g. 2).
step NO integer A number that represents the progress in the checkout process. Usually at a click product event, this is 0.
unit NO text The measurement unit of the item promoted (e.g. pcs, kg).
unitPrice NO float Price of one unit (that you provided) of the item promoted (in the currency that you provided).
variant NO text The variant of the product (e.g. 'black') promoted.


Click promo event implementation example

   

        // sample product data for single product
        var clickPromoProperties = {
            'contentType': 'Product',
            'creative': 'book_42',
            'id': 'item_42',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': undefined,
            'currency': 'HUF',
            'customerValue': '150.0',
            'ean': 9780575115347,
            'list': 'Checkout',
            'position': 1,
            'quantity': 1,
            'step': 2,
            'unit': 'pcs',
            'unitPrice': 2500.0,
            'variant': 'hardcover'
        }


        // sample product data for bundle offer
        var clickPromoProperties = {
            'contentType': 'Product',
            'creative': 'bundle_offer_01',
            'id': 'item_42pack',
            'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': [{
                'contentType': 'Product',
                'currency': 'HUF',
                'id': 'item_42',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 7500.0,
                'unit': 'pcs',
                'unitPrice': 2500.0,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
                {
                'contentType': 'Product',
                'currency': 'USD',
                'id': 'item_42en',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 25.935,
                'unit': 'pcs',
                'unitPrice': 8.645,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
            ]
            'currency': 'HUF',
            'customerValue': '150.0',
            'ean': 9780575115347,
            'list': 'Checkout',
            'position': 1,
            'quantity': 1,
            'step': 2,
            'unit': 'pcs',
            'unitPrice': 15000.0,
            'variant': 'hardcover'
        }

        // Use one of these to add the event listener to the button click (use only one):

        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('book_42_promo').addEventListener('click', function() {
            bp('track', 'clickPromo', clickPromoProperties);
        });

        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("#book_42_promo").click(function() {
            bp('track', 'clickPromo', clickPromoProperties);
        });

    


Sign Up (signUp)

  • Firing event: Button click that completes the registration or login process
  • User intent: Register for or login to a user account or a newsletter subscription
  • Why do we need this: Users demonstrate interest in your market area by signing up for an account

This event should be usually sent along the set user properties event, since this event only captures the actual signup, not the user itself. This event should both be fired if a user registers for an account or subscription for the first time and when they login afterwards. Unsuccessful login or signup events should cause error events to be sent. If possible, it is better if only successful attempts send a sign up event, but it is more important for all signing ups to send an event than for each signup to be only sent once.


Add to cart event properties

key required type description
contentType YES text If the user signs up for a product, then it should be 'Product' else this can be 'Page' if it is a general registration or login.
id YES text This should be your unique ID for the form used to register or login.
name YES text The name of the for used for the signing up, for example 'Register' or 'Sign In'.
brand NO text The brand of the product the user signs up for.
category NO text The subcategory branch (preferred, eg. 'clothes|shoes|winter', separate levels with '|') or single category (eg. 'winter shoes' or 'summer shoes') of the item.
contents NO array An array of JS objects for detailing multiple items of the item. For more details see the table below.
currency NO text (ISO 4217) The currency that the price is provided in, preferably in the three letter ISO 4217 format (eg. HUF, EUR).
customerValue NO float A metric that you define that measures the value of the action performed to your business.
ean NO text Contains the International Article Number (EAN) of the offer if available.
totalItemPrice NO float The total price of the subscribed items in the given currency.
unit NO text The unit that your subscribed item is measured in (eg. pieces, kg, hours).
unitPrice NO float The price of one measurement of your item in the given currency.
variant NO text THehvariant of the offer from the list of possible identical items (eg. the color of a phone or the time and venue of a concert or movie)


Sign up event implementation example

   

        // sample subscription data
        var signUpProperties = {
            'contentType': 'Product',
            'id': 'item_42',
            'name': "Hitchhikers' Guide to the Galaxy, newsletter",
            'brand': 'Gollancz',
            'category': 'books|hardcover|scifi, books|hardcover|comedy',
            'contents': undefined,
            'currency': 'HUF',
            'customerValue': '150',
            'ean': 9780575115347,
            'totalItemPrice': 49900.0,
            'unit': 'pcs.',
            'unitPrice': 4990.0,
            'variant': 'hardcover'
        }


        // Use one of these to add the event listener to the button click (use only one):

        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('signup_button').addEventListener('click', function() {
            bp('track', 'signUp', signUpProperties);
        });

        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("#signup_button").click(function() {
            bp('track', 'signUp', signUpProperties);
        });

    


Search (search)

  • Firing event: Button click that starts a search on a page
  • User intent: Search for an offer on your page
  • Why do we need this: Users demonstrate interest in an offer by searching for it

This event is quite straightforward, every time a search button is clicked, this should send. If the search has no search button, but instead gives results on the change of the search box, then this event can be sent if the user clicks on a result. In this case, searches are sent asynchronously for partial search terms, which should not in themselves send an event. If you have a product selection page where items can be filtered, then the same can apply, the search string in this case can be the query that the settings make that can be read in your browser address bar in HTTP properties (eg. 'goats' in this: 'https://www.google.com/search?ei=A3rRXNHmJY-nrgSJs5HgDQ&q=goats').


Search event properties

key required type description
searchString YES text The search terms entered by the user or the HTTP property that contains the search terms.
contents NO array An array of JS objects containing the top ten results of your search.
contentType NO text Usually this should be 'Product'.
currency NO text (ISO 4217) If you have a filter that selects products by price, and the search string doesn't contain this, then you should provide it here.
customerValue NO float A metric that you define that measures the value of the action performed to your business.
id NO float The id of the search facility that the search is made in, for example of a search box or a filter array.
name NO text The name of the search facility that the search is made in, for example of a search box or a filter array.
totalResults NO integer The number of the search or filter results.


Search event implementation example

   

        // sample search result data
        var searchProperties = {
            'searchString': 'BIG goats',
            'contents': [{
                'contentType': 'Product',
                'currency': 'HUF',
                'id': 'item_42',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 7500.0,
                'unit': 'pcs',
                'unitPrice': 2500.0,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                },
                {
                'contentType': 'Product',
                'currency': 'USD',
                'id': 'item_42en',
                'name': "Hitchhikers' Guide to the Galaxy, hardcover, ISBN: 9780575115347",
                'quantity': 3,
                'totalItemPrice': 25.935,
                'unit': 'pcs',
                'unitPrice': 8.645,
                'brand': 'Gollancz',
                'category': 'books|hardcover|scifi, books|hardcover|comedy',
                'description': 'The Hitchhiker's Guide to the Galaxy[1] is a comedy science fiction series created by Douglas Adams.'
                'ean': 9780575115347,
                'imageURL': 'https://images-na.ssl-images-amazon.com/images/I/51MzUz8rQcL._SX305_BO1,204,203,200_.jpg',
                'variant': 'hardcover'
                }],
            'contentType': 'Product',
            'currency': undefined,
            'customerValue': 150.0,
            'id': 'search_01',
            'name': 'Book Search',
            'totalResults': 2
            }
        }


        // Use one of these to add the event listener to the button click (use only one):

        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('search_button').addEventListener('click', function() {
            bp('track', 'search', searchProperties);
        });

        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("#search_button").click(function() {
            bp('track', 'search', searchProperties);
        });

    


Error (error)

  • Firing event: Any event that results in erroneous operation
  • User intent: Something else
  • Why do we need this: We can get more information about event failures

This event should be sent each time the page can't complete the requested operation, for examnple on 40x or 50x pages, failed form submissions et cetera.


Error event properties

key required type description
description YES text The description of the error, or preferably the full error message.
code NO int The error code.


Error event implementation example

   

        // on a static 404 page
        var errorProperties = {
            'description': 'I find your lack of navigation disturbing.',
            'code': 404
            }
        }


        bp('track', 'error', errorProperties);

    


Custom Event (customEvent)

  • Firing event: Any action that can't be described with our events
  • User intent: Something different
  • Why do we need this: We can get more information

This event is for describing any event that can't be otherwise described with our standard events.


Error event properties

key required type description
eventAction NO text The action that the user takes, eg. click.
eventCategory NO text The category that the event falls in, you can define it for yourself, eg. 'user_settings'.
eventLabel NO text The label associated with the event, eg. 'language_selection'.
eventProperty NO text The property associated with the event, eg. 'unit_format'.
eventValue NO text The value of the property associated with the event, eg. 'metric'.


Custom event implementation example

   

        // for measuring unit selection
        var customEventProperties = {
            'eventAction': 'click',
            'eventCategory': 'user_settings',
            'eventLabel': 'language_selection',
            'eventProperty': 'unit_format',
            'eventValue': 'metric'
            }
        }


        // Use one of these to add the event listener to the button click (use only one):

        // vanilla JS (if you don't use jQuery, if in your console "$" is not defined on your site)
        document.getElementById('set_language').addEventListener('click', function() {
            bp('track', 'customEvent', customEventProperties);
        });

        // jQuery (if you use jQuery, if in your console "$" is defined on your site)
        $("#set_language").click(function() {
            bp('track', 'customEvent', customEventProperties);
        });