DataLayer for Google Tag Manager
How To Configure
DataLayer for Google Tag Manager

Integrate BounceX with Google Tag Manager

Please Note: The settings below require our Datalayer for Google Tag Manager for Magento and some features also require our Enhanced Ecommerce extension.

Purchase
Tag Configuration
  Tag type : Custom Html

Trigger Configuration
  Trigger: All Custom Events
  Event Name : purchase

HTML

<script>
require(['DataLayerPurchaseApi'], function (dataLayerPurchaseApi) {
    var purchase = dataLayerPurchaseApi();
    
    var bouncexFormat = {
        renameFieldTo: {id: 'sku', product_id: 'product_id' quantity: 'quantity', price: 'price'}
    }; 
    
    var bouncexItems = purchase.getItems(bouncexFormat);
    
    <!-- Start BounceX Conversion MultiPixel. Deploy at the beginning of document head. -->
    top.bouncex = top.bouncex || [];
    top.bouncex.push(["conversion", {
        "order_id": purchase.getOrderId(),
        "email": purchase.getEmail(),
        "phone":"",
        "goal":"purchase",
        "transaction_origin": "website",
        "currency": purchase.getCurrencyCode(),
        "coupon": purchase.getOrder('coupon').split(','),
        "total_discount":purchase.getOrder('coupon'),
        "tax":purchase.getOrderTax(),
        "shipping":purchase.getOrderShipping(),
        "amount":purchase.getOrderTotal(),
        "pay_method":purchase.getPaymetMethod('title'),
        "item":bouncexItems
    }]);
    <!-- End BounceX Conversion MultiPixel. -->
    
    var queryParms = {
        website_id: 'Add your Container Tag Id here',
        order_id: purchase.getOrderId(),
        email: purchase.getEmail(),
        amount: purchase.getOrderTotal(),
        goal: 'purchase'
    };
    
    purchase.setUrlDomain('//api.bounceexchange.com/capture/convert2.gif');
    purchase.addUrlParams(queryParms);
        
    var url = purchase.buildUrl();
    purchase.addImage(url);  
});
</script>
Related

Related Extensions

Get more from your Magento2 store!

Catalog Hover Image for Magento

Quickly previewing alternative product images on your category list page.

Magento Enhanced E-commerce

If your are using Magento + Google Analytics, then you need Enhanced E-commerce for Google Tag Manager.

Order Shipment Tracking

Providing your customer with a beautiful and functional order package tracking without leaving your site.