DataLayer for Google Tag Manager
How To Configure
Purchase Extension

Related Extensions

Get more from your Magento2 store!

Magento Enhanced E-commerce

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

Catalog Hover Image for Magento

Quickly previewing alternative product images on your category list page.

DataLayer for Tag Manager

Whether you are integrating Bing, Facebook, SnapChat, Pinterest, or any other services our extension make it easy.

Integrate CJ Affiliate with Google Tag Manager

All Page View

Set cookie if user is coming from a CJ Affiliate (site.com/?cjevent=abc123)

Tag Configuration
  Tag type : Custom Html

Trigger Configuration
  Trigger: All Pages

HTML

<script>
require(['DataLayerApi'], function (dataLayerApi) {
    var dataHelper = dataLayerApi();
    
    <!-- CJ Affiliate Code -->
    dataHelper.saveTrackingCodeIfKeyExist("cjevent");
    <!-- CJ Affiliate Code -->
});
</script>
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 queryParms = {
        containerTagId: 'Add your Container Tag Id here',
        OID: purchase.getOrder('order_id'),
        TYPE: 'Add your Type Id here',
        CURRENCY: purchase.getCurrencyCode(),
        DISCOUNT: purchase.getOrder('discount'),
        COUPON: purchase.getOrder('coupon_code'),
        CJEVENT: purchase.getTrackingCodeIfKeyExist('cjevent', true)
    };
    
    var cjFormat = {
        renameFieldTo: {id:'ITEM', quantity:'QTY', price:'AMT'},
        appendIndex: true
    }; 
    
    var cjItems = purchase.getItems(cjFormat);
    
    purchase.setUrlDomain('//www.emjcd.com/tags/c/');
    purchase.addUrlParams(queryParms);
    purchase.addUrlParams(cjItems);
    
    var url = purchase.buildUrl();
    purchase.addIframe(url);
});
</script>
Related

Related Extensions

Get more from your Magento2 store!

Enhanced Success Page

Add cross-sell, upsell, related products, social media links and other elements to your order confirmation.

Enhanced Transactional Emails

Get more from your order confirmation emails by promoting other complementary products.

Catalog Hover Image for Magento

Quickly previewing alternative product images on your category list page.