You are here

Google Analytics Enhanced Ecommerce

setup

Please refer to the container setup instructions

tagging plans

santianoEcommerce Flat Object

santianoEcommerce Flat Object
santianoEcommerce has a totally flat architecture that facilitates its implementation, covers all Google Analytics Enhanced Ecommerce Tags + other tags needed by other vendors for Ecommerce tracking

  // the santianoEcommerce flat Ecommerce object 
dataLayer.push({
    'event': 'santianoEcommerce',
    'eventCommand': '[eventCommand]',
// overview of all supported eventCommand values:
  // [eventCommand] == 'productImpression'-> products are seen on a list
  // [eventCommand] == 'productClick' -> product is clicked from a list
  // [eventCommand] == 'productDetail' -> product page is viewed
  // [eventCommand] == 'cartProductAdded' -> product is added to cart
  // [eventCommand] == 'cartProductRemoved' -> product is removed from cart
  // [eventCommand] == 'cartContent' -> updates the content of the cart
  // [eventCommand] == 'checkoutStep' -> one step of checkout is loaded or executed 
  // [eventCommand] == 'orderConfirmation' -> thank you for your purchase, receipt here
  // [eventCommand] == 'wishlistProductAdded' -> a product is added to the wishlist
  // [eventCommand] == 'wishlistProductRemoved' -> a product is removed from wishlist
  // [eventCommand] == 'wishlistContent' -> the content of the wishlist
  // [eventCommand] == 'orderRefund' -> order is being canceled altogether
  // [eventCommand] == 'productRefund' -> some products are being refunded
  // [eventCommand] == 'promotionImpression' -> impression count
  // [eventCommand] == 'promotionClick' -> click count

// always defined
  'currencyCode': 'EUR', 
  // what currency here ? https://en.wikipedia.org/wiki/ISO_4217

// only when:
  // 'eventCommand' == 'productImpression'
  // 'eventCommand' == 'productClick'
  'productImpressionListName' : '[ListName]', // string
    // name for that list of products

// only when 'eventCommand' == 'checkoutStep'
  'checkoutStepNumber': 1, // Whole positive number
  'checkoutStepName' : '[checkoutStepName]', // string
  'checkoutStepOption': '[checkoutStepOption]', // string
    
// only when 'eventCommand' == orderConfirmation
  'orderID': '1234569-ABCDEFG', // string - the ID of the Order
  'orderRevenue' : '695.00', // floating number - The Revenue of the order
  'orderTax' : '579.17', // floating number - Tax for that order
  'orderShippingCost' : '15.00', // floating number - The Cost of shipping
  'orderShopName' : '[orderShopName]', // string - 
  'orderCoupon' : '[orderCoupon]', //  string - The Coupons used for that order
  // optional order variables:
    // 'orderPaymentPlatform': '[orderPaymentPlatform]', // string - 
    // 'orderPaymentMethod': '[orderPaymentMethod]', // string - 
    // 'orderShippingCountry': '[orderShippingCountry]', // string - 
    // 'orderShippingRegion': '[orderShippingRegion]', // string - 
    // 'orderShippingCity': '[orderShippingCity]', // string - 
    // 'orderShippingPostCode': '[orderShippingPostCode]', // string - 
    // 'orderBillingCountry': '[orderBillingCountry]', // string - 
    // 'orderBillingRegion': '[orderBillingRegion]', // string - 
    // 'orderBillingCity': '[orderBillingCity]', // string - 
    // 'orderBillingPostCode': '[orderBillingPostCode]', // string - 
    // 'orderTimeStamp' : '[orderTimeStamp]', // string - 

// here is the standard ProductList of each individual productObject:
  'productList': [{
      'productName': '[productName]', // string -The unique Name of that product
      'productID': '[productID]', // string- The product unique ID
      'productUnitPrice': '19.99', // floating - the price of that product
      'productCategory1' : '[productCategory1]', // string - 
      'productCategory2' : '[productCategory2]', // string -
      'productCategory3' : '[productCategory3]', // string -
      'productCategory4' : '[productCategory4]', // string -
      'productCategory5' : '[productCategory5]', // string -
      'productBrand': '[productBrand]', // string - Brand of the product
      'productVariant': '[productVariant]', // string - 
      // optional product variables
        // 'productColor': '[productColor]', // string - 
        // 'productSize': '[productSize]', // string - 
        // 'productReleaseDate': 'DD/MM/AAAA', // string - 
        // 'productType': '[productType]', // string - 
        // 'productInSale': false, // boolean - 
        // 'productOriginalPrice': '67.5', // string - 

      // only for the following 'eventCommand':
          // [eventCommand] == 'productImpression'
          // [eventCommand] == 'productClick'
             'productImpressionListPosition': 1, 
                // ON what position is the product on that ListName ?
                //  Starts With 1 always.

      // only for the following 'eventCommand':
          // [eventCommand] == 'cartProductAdded'
          // [eventCommand] == 'cartProductRemoved'
          // [eventCommand] == 'cartContent'
          // [eventCommand] == 'wishlistProductAdded'
          // [eventCommand] == 'wishlistProductRemoved'
          // [eventCommand] == 'wishlistContent'
          // [eventCommand] == 'checkoutStep'
          // [eventCommand] == 'orderConfirmation'
          // [eventCommand] == 'productRefund'
              'productQuantity': 1 // The quantity of product
  },
  {
       // and so on if there are multiple products.
  }]
  
// Applies for the following 'eventCommand':
    // [eventCommand] == 'promotionImpression'
    // [eventCommand] == 'promotionClick'
  'promotionList': [{
      'promotionName': '[promotionName]',         // string - The Name of that promotion
      'promotionId': '[promotionId]',             // string - The Id of that promotion
      'promotionCreative': '[promotionCreative]', // string - name of the creative
      'promotionPosition' : '[promotionPosition]' // string - name of the position for that creative
      
  },
  {
       // and so on if there are multiple promotions displayed or clicked
  }]
});
close
productImpression

productImpression
On the category pages listing your products

  // the santianoEcommerce in case of a productImpression
dataLayer.push({
    'event': 'santianoEcommerce',
    'eventCommand': 'productImpression',
    'currencyCode': 'EUR', 
    // what currency here ? https://en.wikipedia.org/wiki/ISO_4217

    'productImpressionListName' : '[ListName]', // string
    // name for that list of products

// here is the standard ProductList of each individual productObject:
    'productList': [{
        'productName': '[productName]', // string -The unique Name of that product
        'productID': '[productID]', // string- The product unique ID
        'productUnitPrice': '19.99', // floating - the price of that product
        'productCategory1' : '[productCategory1]', // string - 
        'productCategory2' : '[productCategory2]', // string -
        'productCategory3' : '[productCategory3]', // string -
        'productCategory4' : '[productCategory4]', // string -
        'productCategory5' : '[productCategory5]', // string -
        'productBrand': '[productBrand]', // string - Brand of the product
        'productVariant': '[productVariant]', // string - 
   
        'productImpressionListPosition': 1, 
                  // ON what position is the product on that ListName ?
                  //  Starts With 1 always.

  },
  {
       // and so on if there are multiple products.
  }]
  
});
close
productClick

productClick
Anytime a user clicks on a link pointing to a product detail page

  // the santianoEcommerce in case of a productClick
dataLayer.push({
    'event': 'santianoEcommerce',
    'eventCommand': 'productClick',
// always defined
  'currencyCode': 'EUR', 
  // what currency here ? https://en.wikipedia.org/wiki/ISO_4217

// only when:
  // 'eventCommand' == 'productImpression'
  // 'eventCommand' == 'productClick'
  'productImpressionListName' : '[ListName]', // string
    // name for that list of products

// here is the standard ProductList of each individual productObject:
  'productList': [{
      'productName': '[productName]', // string -The unique Name of that product
      'productID': '[productID]', // string- The product unique ID
      'productUnitPrice': '19.99', // floating - the price of that product
      'productCategory1' : '[productCategory1]', // string - 
      'productCategory2' : '[productCategory2]', // string -
      'productCategory3' : '[productCategory3]', // string -
      'productCategory4' : '[productCategory4]', // string -
      'productCategory5' : '[productCategory5]', // string -
      'productBrand': '[productBrand]', // string - Brand of the product
      'productVariant': '[productVariant]', // string - 
 
      // only for the following 'eventCommand':
          // [eventCommand] == 'productImpression'
          // [eventCommand] == 'productClick'
            'productImpressionListPosition': 1, 
      // ON what position is the product clicked on that ListName ?

  },
  {
       // and so on if there are multiple products.
  }]
  
});
close
productDetail

productDetail
To record impressions of detail pages

  <script>
// the santianoEcommerce in case of a productDetail
dataLayer.push({
    'event': 'santianoEcommerce',
    'eventCommand': 'productDetail',
// always defined
    'currencyCode': 'EUR', 
  // what currency here ? https://en.wikipedia.org/wiki/ISO_4217

// here is the standard ProductList of each individual productObject:
    'productList': [{
        'productName': '[productName]', // string -The unique Name of that product
        'productID': '[productID]', // string- The product unique ID
        'productUnitPrice': '19.99', // floating - the price of that product
        'productCategory1' : '[productCategory1]', // string - 
        'productCategory2' : '[productCategory2]', // string -
        'productCategory3' : '[productCategory3]', // string -
        'productCategory4' : '[productCategory4]', // string -
        'productCategory5' : '[productCategory5]', // string -
        'productBrand': '[productBrand]', // string - Brand of the product
        'productVariant': '[productVariant]', // string - 
   
  },
  {
       // and so on if there are multiple products.
  }]
  
});
</script>
close
cartProductAdded

cartProductAdded
When one or more products are added to cart

  // the santianoEcommerce in case of a cartProductAdded
dataLayer.push({
    'event': 'santianoEcommerce',
    'eventCommand': 'cartProductAdded',
// always defined
    'currencyCode': 'EUR', 
  // what currency here ? https://en.wikipedia.org/wiki/ISO_4217

// here is the standard ProductList of each individual productObject:
    'productList': [{
        'productName': '[productName]', // string -The unique Name of that product
        'productID': '[productID]', // string- The product unique ID
        'productUnitPrice': '19.99', // floating - the price of that product
        'productCategory1' : '[productCategory1]', // string - 
        'productCategory2' : '[productCategory2]', // string -
        'productCategory3' : '[productCategory3]', // string -
        'productCategory4' : '[productCategory4]', // string -
        'productCategory5' : '[productCategory5]', // string -
        'productBrand': '[productBrand]', // string - Brand of the product
        'productVariant': '[productVariant]', // string - 

         // added quantity
         'productQuantity': 1 // The quantity of product
  },
  {
       // and so on if there are multiple products.
  }]
  
});
close
cartProductRemoved

cartProductRemoved
When a product is removed from cart

  // the santianoEcommerce in case of a cartProductRemoved
dataLayer.push({
    'event': 'santianoEcommerce',
    'eventCommand': 'cartProductRemoved',
// always defined
    'currencyCode': 'EUR', 
  // what currency here ? https://en.wikipedia.org/wiki/ISO_4217

// here is the standard ProductList of each individual productObject:
    'productList': [{
        'productName': '[productName]', // string -The unique Name of that product
        'productID': '[productID]', // string- The product unique ID
        'productUnitPrice': '19.99', // floating - the price of that product
        'productCategory1' : '[productCategory1]', // string - 
        'productCategory2' : '[productCategory2]', // string -
        'productCategory3' : '[productCategory3]', // string -
        'productCategory4' : '[productCategory4]', // string -
        'productCategory5' : '[productCategory5]', // string -
        'productBrand': '[productBrand]', // string - Brand of the product
        'productVariant': '[productVariant]', // string - 

         // how many of that product is removed ?
              'productQuantity': 1 // The quantity of product
  },
  {
       // and so on if there are multiple products.
  }]
  
});
close
checkoutStep

checkoutStep
For every numbered and named step of your checkout funnel

  // the santianoEcommerce in case of a checkoutStep
dataLayer.push({
    'event': 'santianoEcommerce',
    'eventCommand': 'checkoutStep',
    'currencyCode': 'EUR', 

  // checkout steps specific variables
    'checkoutStepNumber': 1, // Whole positive number, starts with 1
    'checkoutStepName' : '[checkoutStepName]', // string
    'checkoutStepOption': '[checkoutStepOption]', // string

// here is the standard ProductList of each individual productObject:
    'productList': [{
        'productName': '[productName]', // string -The unique Name of that product
        'productID': '[productID]', // string- The product unique ID
        'productUnitPrice': '19.99', // floating - the price of that product
        'productCategory1' : '[productCategory1]', // string - 
        'productCategory2' : '[productCategory2]', // string -
        'productCategory3' : '[productCategory3]', // string -
        'productCategory4' : '[productCategory4]', // string -
        'productCategory5' : '[productCategory5]', // string -
        'productBrand': '[productBrand]', // string - Brand of the product
        'productVariant': '[productVariant]', // string - 

        // how many products are in the cart at that moment ???
        'productQuantity': 1 // The quantity of product
  },
  {
       // and so on if there are multiple products.
  }]
  
});
close
orderConfirmation

orderConfirmation
The favorite moment !!! The Full Receipt of the order with its orderVariables and the full content of the products purchased.

  // the santianoEcommerce in case of a orderConfirmation
dataLayer.push({
    'event': 'santianoEcommerce',
    'eventCommand': 'orderConfirmation',
    'currencyCode': 'EUR', 

  // orderConfirmation specific variables
    'orderID': '1234569-ABCDEFG', // string - the ID of the Order
    'orderRevenue' : '695.00', // floating number - The Revenue of the order
    'orderTax' : '579.17', // floating number - Tax for that order
    'orderShippingCost' : '15.00', // floating number - The Cost of shipping
    'orderShopName' : '[orderShopName]', // string - 
    'orderCoupon' : '[orderCoupon]', //  string - The Coupons used for that order

// here is the standard ProductList of each individual productObject:
    'productList': [{
        'productName': '[productName]', // string -The unique Name of that product
        'productID': '[productID]', // string- The product unique ID
        'productUnitPrice': '19.99', // floating - the price of that product
        'productCategory1' : '[productCategory1]', // string - 
        'productCategory2' : '[productCategory2]', // string -
        'productCategory3' : '[productCategory3]', // string -
        'productCategory4' : '[productCategory4]', // string -
        'productCategory5' : '[productCategory5]', // string -
        'productBrand': '[productBrand]', // string - Brand of the product
        'productVariant': '[productVariant]', // string - 

        // how many products are puchased ???
        'productQuantity': 1 // The quantity of product
  },
  {
       // and so on if there are multiple products.
  }]
  
});
close
orderRefund

orderRefund
When a full order is returned or canceled.

  // the santianoEcommerce in case of a orderRefund
dataLayer.push({
    'event': 'santianoEcommerce',
    'eventCommand': 'orderRefund',

  // the order that is cancelled
    'orderID': '1234569-ABCDEFG' // string - the ID of the Order
  
});
close
productRefund

productRefund
To return some products from one particular orderId

  // the santianoEcommerce in case of a productRefund
dataLayer.push({
    'event': 'santianoEcommerce',
    'eventCommand': 'productRefund',

  // the order related
    'orderID': '1234569-ABCDEFG', // string - the ID of the Order
    
// products being returned
    'productList': [{
        'productID': '[productID]', // string- The product unique ID
        'productQuantity': 1 // The quantity of product
  },
  {
       // and so on if there are multiple products.
  }]
  
});
close

gtm tags

gaEnhancedEcommerce

gaEnhancedEcommerce
Tag Type : Universal Analytics - Google Analytics
Google Analytics Enhanced Ecommerce Hits

  Track Type : Event
Category : {{eventCategory}}
Action : {{eventAction}}
Label : {{eventLabel}}
Value : 0
Non Interaction Hit : True
Google Analytics Seetings : {{gaConfigEnhancedEcommerce}}
close
santianoEcommerce to gaEnhancedEcommerce

santianoEcommerce to gaEnhancedEcommerce
Tag Type : Custom HTML

  <script>
// grabs the santiano Ecommerce Event and plays with it for Google Enhanced Ecommerce
  // all the controls are in the event Commands
  var eventCommand = {{eventCommand}};

  // Common EventCategory for all Enhanced Ecommerce 
  var eventCategory = 'Enhanced Ecommerce';

  // My already GA formatted products are here
  var gaEcommerceProducts = {{gaEcommerceProducts}};

  switch (eventCommand) {
    case 'productImpression':
      var eventAction = 'Product Impression';
      var eventLabel = 'On list:{{productImpressionListName}}';
      var enhancedEcommerceObject = {
        'currencyCode': {{currencyCode}},
        'impressions': gaEcommerceProducts
      };
      break;

    case 'productClick':
      var productList = {{productList}};
      var eventAction = 'Product Click';
      var eventLabel = 'productId clicked is:' + productList[0].productId;
      var enhancedEcommerceObject = {
        'currencyCode': {{currencyCode}},
        'click': {
          'actionField': {'list': + {{productImpressionListName}}},
          'products': gaEcommerceProducts
         }
      };
      break;

    case 'productDetail':
      var productList = {{productList}};
      var eventAction = 'Product Detail';
      var eventLabel = 'productId viewed is:' + productList[0].productId;
      var enhancedEcommerceObject = {
        'currencyCode': '{{currencyCode}}',
        'detail': {
          'products': gaEcommerceProducts
         }
       };
      break;

    case 'cartProductAdded':
      var productList = {{productList}};
      var eventAction = 'Product added to cart';
      var eventLabel = 'productId added is:' + productList[0].productId;
      var enhancedEcommerceObject = {
            'currencyCode': '{{currencyCode}}',
            'add': {
                'products': gaEcommerceProducts
            }
        };
      break;

    case 'cartProductRemoved':
      var productList = {{productList}};
      var eventAction = 'Product removed from cart';
      var eventLabel = 'productId removed is:' + productList[0].productId;
      var enhancedEcommerceObject = {
            'currencyCode': '{{currencyCode}}',
            'remove': {
                'products': gaEcommerceProducts
            }
      };
      break;

    case 'checkoutStep':
      var eventAction = 'Checkout step {{checkoutStepNumber}}';
      var eventLabel = {{checkoutStepName}} + ' with ' + {{checkoutStepOption}};
      var enhancedEcommerceObject = {
        'currencyCode': '{{currencyCode}}',
        'checkout': {
          'actionField': {'step': {{checkoutStepNumber}} ,'option': {{checkoutStepOption}} },
        'products': gaEcommerceProducts
        }
      };
      break;

    case 'orderConfirmation':
      var eventAction = 'Order Confirmation';
      var eventLabel = 'orderId confirmed is:' + {{orderId}};
      var enhancedEcommerceObject = {
        'currencyCode': '{{currencyCode}}',
        'purchase': {
          'actionField': {
            'id': {{orderId}},
            'affiliation': {{orderShopName}},
            'revenue': {{orderRevenue}},
            'tax':{{orderTax}},
            'shipping': {{orderShippingCost}},
            'coupon': {{orderCoupon}}

          },
        'products': gaEcommerceProducts
        }
      };
      break;

    case 'productRefund':
      var eventAction = 'Product Refund';
      var eventLabel = 'productId refunded is:' + productList[0].productId;
      var enhancedEcommerceObject = {
        'refund': { 
          'actionField': {
            'id': {{orderId}}
          },
          'products': gaEcommerceProducts
        }
      };
      break;

    case 'orderRefund':
      var eventAction = 'Order Refund';
      var eventLabel = 'orderId Refunded is:' + {{orderId}};
      var enhancedEcommerceObject = {
        'refund': {
          'actionField': {
            'id': {{orderId}},     
          }
        }
      };
      break;

  } // end of Switch statement


dataLayer.push({
  'event': 'gaEnhancedEcommerce',
  'eventCategory': eventCategory,
  'eventAction': eventAction,
  'eventLabel': eventLabel,
  'ecommerce': enhancedEcommerceObject
});


</script>
close

gtm triggers

Event - santianoEcommerce - cartProductAdded

Event - santianoEcommerce - cartProductAdded
Trigger Type : Custom Event
When a product is added to cart
Event name equals santianoEcommerce eventCommand equals cartProductAdded

close
Event - santianoEcommerce - cartProductRemoved

Event - santianoEcommerce - cartProductRemoved
Trigger Type : Custom Event
When a product is removed from cart
Event name = santianoEcommerce eventCommand equals cartProductRemoved

close
Event - santianoEcommerce - checkoutStep

Event - santianoEcommerce - checkoutStep
Trigger Type : Custom Event
For every step checkout
Event name equals santianoEcommerce

close
Event - santianoEcommerce - orderConfirmation

Event - santianoEcommerce - orderConfirmation
Trigger Type : Custom Event
Thank you for your order
Event name equals santianoEcommerce eventCommand equals orderConfirmation

close
Event - santianoEcommerce - orderRefund

Event - santianoEcommerce - orderRefund
Trigger Type : Custom Event
When order returns
Event name equals santianoEcommerce eventCommand equals orderRefund

close
Event - santianoEcommerce - productClick

Event - santianoEcommerce - productClick
Trigger Type : Custom Event
When a product is clicked
Event Name equals santianoEcommerce eventCommand equals productClick

close
Event - santianoEcommerce - productDetail

Event - santianoEcommerce - productDetail
Trigger Type : Custom Event
When a product page is seen
Event name equals santianoEcommerce eventCommand equals productDetail

close
Event - santianoEcommerce - productImpression

Event - santianoEcommerce - productImpression
Trigger Type : Custom Event
When products are seen on a list of products
Event name equals santianoEcommerce eventCommand equals productImpression

close
Event - santianoEcommerce - productRefund

Event - santianoEcommerce - productRefund
Trigger Type : Custom Event
When some products returns from one particular order
Event name equals santianoEcommerce eventCommand equals productRefund

close
Event - santianoEcommerce - promotionClick

Event - santianoEcommerce - promotionClick
Trigger Type : Custom Event
When a click on an ad or banner occurs
Event name equals santianoEcommerce eventCommand equals promotionClick

close
Event - santianoEcommerce - promotionImpression

Event - santianoEcommerce - promotionImpression
Trigger Type : Custom Event
When Promotions or banners are displayed
Event name equals santianoEcommerce eventCommand equals promotionImpression

close

gtm variables

checkoutStepName

checkoutStepName
Variable Type : Data Layer Variable
Name of the checkout step being displayed or validated

  Data Layer Variable Name : checkoutStepName
Data Layer Version : Version 2
close
checkoutStepNumber

checkoutStepNumber
Variable Type : Data Layer Variable
Number of the cjeckout step, always starts with 1

  Data Layer Variable Name : checkoutStepNumber
Data Layer Versison : Version 2

close
checkoutStepOption

checkoutStepOption
Variable Type : Data Layer Variable
Specific option for that checkout step

  Data Layer Variable Name : checkoutStepOption
Data Layer Version Version 2

close
currencyCode

currencyCode
Variable Type : Data Layer Variable
Currency code... 'EUR' , 'USD' , ...

  Data Layer Variable Name  currencyCode
Data Layer Version : Version 2
close
eventAction

eventAction
Variable Type : Data Layer Variable
The eventAction seet by santianoEvent and santianoEcommerce to be used by a variety of vendors

  Data Layer Variable Name : eventAction
Data Layer Version : Version 2
close
eventCategory

eventCategory
Variable Type : Data Layer Variable
The eventCategory sent by santianoEvent and santianoEcommerce to be used by a variety of vendors

  Data Layer Variable Name : eventCategory
Data Layer Version : Version 2
close
eventCommand

eventCommand
Variable Type : Data Layer Variable
santiano.io comes with its specific eventCommand : its naming scheme facilitates management and maintenance of events tags and ecommerce tags.

  Data Layer Variable Name  : eventCommand 
Data Layer Version : Version 2
close
eventLabel

eventLabel
Variable Type : Data Layer Variable
The eventLabel sent by santianoEvent and santianoEcommerce to be used by a variety of vendors

  Data Layer Variable Name : Label
Data Layer Version : Version 2
close
eventPartition

eventPartition
Variable Type : Data Layer Variable
The event Pasent by santianoEvent and santianoEcommerce to be used by a variety of vendors

  Data Layer Variable Name : eventPartition
Data Layer Version : Version 2
close
eventSegment

eventSegment
Variable Type : Data Layer Variable
The eventSegment sent by santianoEvent and santianoEcommerce to be used by a variety of vendors

  Data Layer Variable Name : eventSegment
Data Layer Version : Version 2
close
eventValue

eventValue
Variable Type : Data Layer Variable
The eventAction sent by santianoEvent and santianoEcommerce to be used by a variety of vendors

  Data Layer Variable Name : eventValue
Data Layer Version : Version 2
close
gaConfigEnhancedEcommerce

gaConfigEnhancedEcommerce
Variable Type : Google Analytics Settings
Holding Google Analytics configuration for Enhanced Ecommerce Hits

  Tracking ID : {{gaProperty}}
Cookie Domain : ato
Enable Enhanced Ecommerce Features : YES
Use Data Layer : YES
close
gaEcommerceProducts

gaEcommerceProducts
Variable Type : Custom Javascript
Manages the product List and prepares the product List for Google Analytics Enhanced Ecommerce object.

  function() {
// grabs the productList from the santiano.io Ecommerce Events and prepares it for Google Enhanced Ecommerce
var eventCommand = {{eventCommand}};
var productList = {{productList}};
var productListLength = {{productListLength}};
var gaEcommerceProducts = [];
var i;

for ( i = 0; i < productListLength; i++ ) {

    // initializing a new GA product with its common vars
    var gaIndividualProduct = {
      // Product variables defined for all EE GA hits
      'id': productList[i].productID,
      'name': productList[i].productName,
      'price': productList[i].productUnitPrice,
      'variant': productList[i].productVariant,
      'brand': productList[i].productBrand
      //'dimensionXX': productList[i].productCustomDimension
      //'metricXX': productList[i].productCustomMetric
    };

    // 5 level category magic
    var eeCategoryMagic = [];
    if (productList[i].productCategory1 != undefined) {
      eeCategoryMagic.push(productList[i].productCategory1);
    }
    if (productList[i].productCategory2 != undefined) {
      eeCategoryMagic.push(productList[i].productCategory2);
    }
    if (productList[i].productCategory3 != undefined) {
      eeCategoryMagic.push(productList[i].productCategory3);
    }
    if (productList[i].productCategory4 != undefined) {
      eeCategoryMagic.push(productList[i].productCategory4);
    }
    if (productList[i].productCategory5 != undefined) {
    eeCategoryMagic.push(productList[i].productCategory5);
    }
  	// Reminder for later... include the dynamic replacement of '/' characters in categoryVars if any :)
    // From list to string
    eeCategoryMagic = eeCategoryMagic.join('/');
    // pushing to the gaIndividualProduct as category
    gaIndividualProduct.category = eeCategoryMagic;

    // product in cart and order specific variables
    if (eventCommand == 'cartProductAdded' ||
        eventCommand == 'cartProductRemoved' || 
        eventCommand == 'checkoutStep' ||
        eventCommand == 'productRefund' ||
        eventCommand == 'orderConfirmation') {
        // these events need a productQuantity associated with each product
          gaIndividualProduct.quantity = productList[i].productQuantity;
          // gaIndividualProduct.dimensionXX = productInCartSpecificDimension
          // gaIndividualProduct.metricXX = productInCartSpecificMetric
    }

    // productImpression and productClick specific 
    if (eventCommand == 'productImpression') {
          // productImpression always need :

          gaIndividualProduct.position = productList[i].productImpressionListPosition;
              // the position of that product on that list

          gaIndividualProduct.list = {{productImpressionListName}};
              // the name of that list

          // gaIndividualProduct.dimensionXX = productImpressionSpecificDimension
          // gaIndividualProduct.metricXX = productImpressionSpecificMetric
    }

    if (eventCommand == 'productClick') {
          // productClick always need :
          gaIndividualProduct.position = productList[i].productImpressionListPosition;
              // the position of that product on that list

          // gaIndividualProduct.dimensionXX = productImpressionSpecificDimension
          // gaIndividualProduct.metricXX = productImpressionSpecificMetric
    }

    gaEcommerceProducts.push(gaIndividualProduct);
  }
  return gaEcommerceProducts;
}

close
gaProperty

gaProperty
Variable Type : Custom Javascript
Dynamic Google Analytics Variable for the individual UA property

  function() {
    var pageHostName = {{pageHostName}};
    var santianoCoreWebsiteIsInProduction = {{santianoCoreWebsiteIsInProduction}};
    var gaUaDev = {{gaUaDev}};
    var gaUaProd = {{gaUaProd}};
    if (santianoCoreWebsiteIsInProduction) {
      	// We are on the Production environment
    	return gaUaProd;
    } else {
      	// We are on Development environment
       return gaUaDev;
    };
}
close
gaUaDev

gaUaDev
Variable Type : Constant
The Google Analytics UA code for your Dev Environment

  Value  : Replace with your Dev UA-XXXXX
close
gaUaProd

gaUaProd
Variable Type : Constant
The production UA property ID needed to be called on your production website

  Value : Replace with your Prod UA-XXXXX
close
orderCoupon

orderCoupon
Variable Type : Data Layer Variable
the promo code or coupons used for that order

  Data Layer Variable Name : orderCoupon
Data Layer Version : Version 2
close
orderId

orderId
Variable Type : Data Layer Variable

  Data Layer Variable Name : orderId
Data Layer Version : Version 2
close
orderRevenue

orderRevenue
Variable Type : Data Layer Variable
Revenue of that order

  Data Layer Variable Name : orderRevenue
Data Layer Version Version : Version 2
close
orderShippingCost

orderShippingCost
Variable Type : Data Layer Variable

  Data Layer Variable Name : orderShippingCost
Data Layer Version : Version 2

close
orderShopName

orderShopName
Variable Type : Data Layer Variable
Name of the Shop

  Data Layer Variable Name : orderShopName
Data Layer Version : Version 2
close
orderTax

orderTax
Variable Type : Data Layer Variable
Tax for that order

  Data Layer Variable Name : orderTax
Data Layer Version : Version 2
close
pageHostName

pageHostName
Variable Type : URL
Providing the hostname of the page being loaded to the user

  Component Type : Host Name
close
pageParameterUtmCampaign

pageParameterUtmCampaign
Variable Type : URL
The url Parameter utm_campaign used by Google Analytics

  Component Type : Query
Query Key : utm_campaign
close
pageParameterUtmContent

pageParameterUtmContent
Variable Type : URL
The value of the Url parameter utm_content used by Google Analytics

  Component Type : Query
Query Key : utm_content

close
pageParameterUtmMedium

pageParameterUtmMedium
Variable Type : URL
The value of the url parameter utm_medium used by Google Analytics

  Component Type : Query
Query key : utm_medium

close
pageParameterUtmSource

pageParameterUtmSource
Variable Type : URL
the url parameter utm_source used by Google Analytics

  Component Type : Query
Query Key : utm_source
close
pageParameterUtmTerm

pageParameterUtmTerm
Variable Type : URL
the url parameter utm_term used by Google Analytics

  Component Type : Query
Query Key : utm_term
close
productImpressionListName

productImpressionListName
Variable Type : Data Layer Variable
Name of the list showing all these great products

  Data Layer Variable Name : productImpressionListName
Data Layer Version : Version 2
close
productList

productList
Variable Type : Data Layer Variable
One of the most important variable of all santianoEcommerce. The productList is an array of productObjects used along all ecommerce events happening on an ecommerce platform.

  Data Layer Variable Name : productList
Data Layer Version : Version 1 !!!!!! Yes version 1

close
productListLength

productListLength
Variable Type : Custom Javascript
Tells us how many distincts products are in the productList

  // returns the number of distinct products in the productList Object
function() {
var productList = {{productList}};
  if (productList === undefined) {
      return 0;
  } else  if (productList === "") {
      return 0;
  } else if (productList === []) {
      return 0;
  } else {
      return productList.length
  }
}
close
promotionListLength

promotionListLength
Variable Type : Custom Javascript

  // returns the number of distinct products in the productList Object
function() {
var promotionList = {{promotionList}};
  if (promotionList === undefined) {
      return 0;
  } else  if (promotionList === "") {
      return 0;
  } else if (promotionList === []) {
      return 0;
  } else {
      return promotionList.length
  }
}
close
santianoApacheV2.0Licence

santianoApacheV2.0Licence
Variable Type : Custom Javascript

    function() {
  // santiano.io is released under Apache V2.0 licence.
  // 
  // Copyright 2018 Santiano Consulting SAS (santiano.io)
  // 
  // Licensed under the Apache License, Version 2.0 (the "License");
  // you may not use this file except in compliance with the License.
  // You may obtain a copy of the License at
  // 
  // http://www.apache.org/licenses/LICENSE-2.0
  // 
  // Unless required by applicable law or agreed to in writing, software
  // distributed under the License is distributed on an "AS IS" BASIS,
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  // See the License for the specific language governing permissions and
  // limitations under the License.
    return 'santiano.io is released under Apache V2.0 licence';
  }
close
santianoCoreAuthorizedDomainNamesList

santianoCoreAuthorizedDomainNamesList
Variable Type : Custom Javascript
Provides a JS array of all production domain names expected to be tracked

  function() {
  // Replace with the list of all Production Domain Names for your own setup
  // remember to include all the domains with their appropriate subdomain
  var santianoCoreAuthorizedDomainNamesList = ['santiano.io', 
                                               'garylemasson.com', 
                                               'www.garylemasson.com', 
                                               'analytics.google.com', 
                                               'tagmanager.google.com'];
  return santianoCoreAuthorizedDomainNamesList;
}

close
santianoCoreWebsiteIsInProduction

santianoCoreWebsiteIsInProduction
Variable Type : Custom Javascript
Grabs santianoCoreAuthorizedDomainNamesList and pageHostName and returns true if we are in Production

  function() {
  var pageHostName = {{pageHostName}};
  var santianoCoreAuthorizedDomainNamesList = {{santianoCoreAuthorizedDomainNamesList}};
  if (santianoCoreAuthorizedDomainNamesList.includes(pageHostName) ) {
    return true
  } else {
    return false
  };
}
close

Add comment

Download

	An easy way to integrate Enhanced Ecommerce

- Full GA Enhanced Ecommerce Features

santianoEcommerce flat object
gaEcommerceProducts
santianoEcommerce to gaEnhancedEcommerce
gaEnhancedEcommerce
container dependencies