{"id":103795,"date":"2025-02-22T17:56:39","date_gmt":"2025-02-22T17:56:39","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/enhanced-ecommerce-guide-for-google-tag-manager\/"},"modified":"2025-02-22T17:56:39","modified_gmt":"2025-02-22T17:56:39","slug":"enhanced-ecommerce-guide-for-google-tag-manager","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=103795","title":{"rendered":"Enhanced Ecommerce Guide For Google Tag Manager"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p><a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/analyticsjs\/enhanced-ecommerce\">Enhanced Ecommerce<\/a> is certainly one of the finest reporting user interface features that <a href=\"https:\/\/analytics.google.com\">Google Analytics<\/a> has to offer. Enhanced Ecommerce, as the name implies, is a set of dimensions, metrics, and reports, which combine to provide you with a fairly complete view into how users are interacting with your products in your webstore. The main downside of Enhanced Ecommerce is, as with all good things, that it\u2019s complicated to implement.<\/p>\n<div style=\"aspect-ratio: 1006 \/ 443;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/enhanced-ecommerce-guide-for-google-tag-manager.jpg\" title=\"enhanced ecommerce guide for google tag manager\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"443\" width=\"1006\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/enhanced-ecommerce-guide-for-google-tag-manager.jpg#ZgotmplZ\" alt=\"enhanced ecommerce guide for google tag manager\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Luckily, there\u2019s <a href=\"https:\/\/tagmanager.google.com\/\">Google Tag Manager<\/a>. Theoretically, you could implement Enhanced Ecommerce through Google Tag Manager without ever adding a single line of functional logic into the codebase of your web site. You could do everything by simply <a href=\"#a-word-on-scraping-the-dom\"><em>scraping<\/em> the Document Object Model<\/a> (DOM). However, as we have hopefully learned over the years &#8211; GTM is a tool with which fastidiousness trumps fast.<\/p>\n<p>Whenever you\u2019re working with <code>dataLayer<\/code>, for example, you\u2019re investing into the stability of your data collection process. Thus, even though I will be talking about DOM scraping <a href=\"#a-word-on-scraping-the-dom\">further on<\/a> in the guide, the focus here will be on a setup where the <strong>front-end<\/strong> produces HTML documents and\/or JavaScript that populates the Ecommerce values into the <code>dataLayer<\/code> without using DOM scraping or other client-side hacks to do the job.<\/p>\n<p>There is a lot of information in this article. Much of it is already covered in Google\u2019s excellent <a href=\"https:\/\/developers.google.com\/tag-manager\/enhanced-ecommerce\">Enhanced Ecommerce Developer Guide<\/a>, but there are plenty of <em>gotchas<\/em> that I might have covered in earlier articles (see the <a href=\"#further-reading\">Further Reading<\/a> chapter), or which I might not even have written down before.<\/p>\n<blockquote>\n<p><strong>NOTE!<\/strong> This is an <strong>implementation<\/strong> guide. If you want to know how Enhanced Ecommerce works or how to map your site into relevant interactions, you\u2019ll want to look at Google\u2019s <a href=\"https:\/\/support.google.com\/analytics\/answer\/6014841?hl=en\">support center documentation<\/a>.<\/p>\n<\/blockquote>\n<p>                <span class=\"simmer\"><br \/>\n  <span class=\"close\">X<\/span><\/p>\n<p>\n    <span class=\"fa fa-md fa-bell\"\/><br \/>\n    <strong>The Simmer Newsletter<\/strong>\n  <\/p>\n<p>\n    Subscribe to the <a href=\"https:\/\/www.simoahava.com\/newsletter\/\">Simmer newsletter<\/a> to get the latest news and content from Simo Ahava into your email inbox!\n  <\/p>\n<p>  <\/span><\/p>\n<h2 id=\"how-to-read-this-guide\">How to read this guide<\/h2>\n<p>Obviously, it would make sense if you read the guide from top-to-bottom. However, I fully acquiesce that the loquaciousness of my rhetoric might be tedious to some in all its verbose glory. Also, sometimes I write douchy things like that.<\/p>\n<p>So, depending on what your role is in the implementation project, there might be only some chapters that are relevant for you. However, don\u2019t neglect to consult with all the stakeholders in the project! It doesn\u2019t make sense for a developer to write code without understanding what the code is needed for. Similarly, it doesn\u2019t make sense for the person operating Google Tag Manager to utilize the <code>dataLayer<\/code> structures without understanding the limitations of the back-end or front-end systems.<\/p>\n<blockquote>\n<p><strong>If you are a developer, tasked with implementing the <code>dataLayer<\/code> objects<\/strong>, you\u2019ll want to read the following chapters (in order):<\/p>\n<\/blockquote>\n<ol>\n<li><a href=\"#introduction\">Introduction<\/a><\/li>\n<li><a href=\"#populate-the-data-layer\">Populate the Data Layer<\/a><\/li>\n<li><a href=\"#a-word-on-scraping-the-dom\">A word on scraping the DOM<\/a><\/li>\n<li><a href=\"#combining-different-data-types-in-a-single-eec-hit\">Combining different data types in a single EEC hit<\/a><\/li>\n<li><a href=\"#product-scoped-custom-dimensions-and-metrics\">Product-scoped Custom Dimensions and Metrics<\/a><\/li>\n<li><a href=\"#remember-be-consistent\">Remember: be consistent<\/a><\/li>\n<li><a href=\"#data-types-actions\">Data types: Actions<\/a> and all its sub-sections<\/li>\n<li><a href=\"#data-types-impressions\">Data types: Impressions<\/a> and all its sub-sections<\/li>\n<li><a href=\"#data-types-promotions\">Data types: Promotions<\/a> and all its sub-sections<\/li>\n<\/ol>\n<blockquote>\n<p><strong>If you are the person tasked with setting up EEC via the Google Tag Manager User Interface<\/strong>, you\u2019ll want to focus on the following chapters (in order):<\/p>\n<\/blockquote>\n<ol>\n<li><a href=\"#introduction\">Introduction<\/a><\/li>\n<li><a href=\"#differences-and-similarities-to-standard-ecommerce\">Differences (and similarities) to Standard Ecommerce<\/a><\/li>\n<li><a href=\"#send-the-data-to-google-analytics-using-the-data-layer\">Send the data to Google Analytics using the Data Layer<\/a><\/li>\n<li><a href=\"#send-the-data-to-google-analytics-using-a-custom-javascript-variable\">Send the data to Google Analytics using a Custom JavaScript variable<\/a><\/li>\n<li><a href=\"#page-view-or-event-tag\">Page View or Event tag<\/a><\/li>\n<li><a href=\"#data-types-actions\">Data types: Actions<\/a> and all its sub-sections<\/li>\n<li><a href=\"#data-types-impressions\">Data types: Impressions<\/a> and all its sub-sections<\/li>\n<li><a href=\"#data-types-promotions\">Data types: Promotions<\/a> and all its sub-sections<\/li>\n<li><a href=\"#debugging-the-setup\">Debugging the setup<\/a><\/li>\n<li><a href=\"#golden-rules-of-enhanced-ecommerce\">Golden rules of Enhanced Ecommerce<\/a><\/li>\n<\/ol>\n<p>As I said, I still wish you\u2019d spend the time reading the entire guide. I don\u2019t think there\u2019s any irrelevant information to anyone working on the project, and it makes sense to understand the full complexity of the implementation rather than focus only on the things that are directly relevant to your work.<\/p>\n<h2 id=\"introduction\">Introduction<\/h2>\n<p>Implementing Enhanced Ecommerce requires an overview of the following components:<\/p>\n<p>All three of these components are necessary, and all three require some understanding of how Google Tag Manager works, how tags and triggers interact with <code>dataLayer<\/code>, and how the Enhanced Ecommerce data is sent to Google Analytics. These will all be covered in this guide.<\/p>\n<div style=\"aspect-ratio: 966 \/ 410;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/implementation-process.jpg\" title=\"Implementation process\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"410\" width=\"966\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/implementation-process.jpg#ZgotmplZ\" alt=\"Implementation process\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Needless to say, if you want a <strong>robust<\/strong> implementation, interaction and co-operation with your site\u2019s front-end developers is <strong>an absolute must<\/strong>. Typically, the front-end developers utilize page templates and server-side variables (using <strong>PHP<\/strong> or <strong>React.js<\/strong>, for example) to build the HTML structure of any given page. On Enhanced Ecommerce pages, it\u2019s important that they integrate the front-end with whatever ecommerce system you have in use, so that this system produces the necessary values dynamically for the front-end developers to funnel through into the <code>dataLayer<\/code>.<\/p>\n<p>For interactions that take place after the page load, such as cart interactions, the front-end developers might need update the site JavaScript to populate the <code>dataLayer<\/code> object with the necessary values in the client.<\/p>\n<p>Or you can just throw caution to the wind and <a href=\"#a-word-on-scraping-the-dom\">scrape everything off the HTML itself<\/a> through Google Tag Manager. The purpose of this guide isn\u2019t to recommend any specific course of action, but to highlight the different ways in which you can run the Enhanced Ecommerce implementation project.<\/p>\n<h2 id=\"differences-and-similarities-to-standard-ecommerce\">Differences (and similarities) to Standard Ecommerce<\/h2>\n<p>If you\u2019ve been running <a href=\"https:\/\/support.google.com\/tagmanager\/answer\/6107169?hl=en\">Standard Ecommerce<\/a> through Google Tag Manager, there are mainly <strong>three<\/strong> major differences between that and Enhanced Ecommerce.<\/p>\n<ul>\n<li>\n<p><strong>Standard Ecommerce<\/strong> only collects transactions (i.e. \u201cPurchase\u201d hits in EEC) &#8211; there are no other components to its funnel (in fact, there is no funnel).<\/p>\n<\/li>\n<li>\n<p><strong>Standard Ecommerce<\/strong> uses a different <code>category<\/code> format.<\/p>\n<\/li>\n<li>\n<p><strong>Standard Ecommerce<\/strong> doesn\u2019t support <a href=\"https:\/\/www.simoahava.com\/gtm-tips\/product-scoped-custom-dimensions-and-metrics\/\">Product-scoped Custom Dimensions and Metrics<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>One thing to pay heed to is that <strong>you can collect both Standard Ecommerce and Enhanced Ecommerce hits<\/strong> to an Enhanced Ecommerce -enabled Google Analytics view! This means that if you leave your \u201cold\u201d tracking in place and run an Enhanced Ecommerce implementation in parallel, you might end up <strong>double-counting<\/strong> transactions.<\/p>\n<p>Google Analytics <em>does<\/em> deduplicate identical transactions sent in a session, but it\u2019s enough for some component in the two different tracking methods to differ for GA to collect the data twice.<\/p>\n<p><strong>Product Category<\/strong> is collected to a different dimension, depending on which method you are using. So if you populate the <code>category<\/code> key for a product using either method, the dimension you\u2019re looking for in GA is going to be different.<\/p>\n<div style=\"aspect-ratio: 648 \/ 209;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/product-category-dimensions.jpg\" title=\"Product Category Dimensions\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"209\" width=\"648\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/product-category-dimensions.jpg#ZgotmplZ\" alt=\"Product Category Dimensions\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h2 id=\"implementation-guidelines\">Implementation guidelines<\/h2>\n<p>The following chapters will cover certain aspects of an Enhanced Ecommerce implementation. As I stated in the <a href=\"#introduction\">Introduction<\/a>, how the values are populated into <code>dataLayer<\/code> depend on the integration between your site\u2019s front-end and the Ecommerce platform you use. Some platforms such as WooCommerce for WordPress introduce this integration using a <a href=\"https:\/\/gtm4wp.com\/how-to-articles\/how-to-setup-enhanced-ecommerce-tracking\">plugin<\/a>, others such as Magento provide it out-of-the-box as a <a href=\"https:\/\/docs.magento.com\/m1\/ee\/user_guide\/marketing\/google-tag-manager.html\">feature<\/a>.<\/p>\n<p>However, there are plenty of custom Ecommerce platforms and setups out there which require tinkering for them to produce the values into variables that your front-end developers can then utilize.<\/p>\n<p>The next chapter, for example, simply instructs what the generic <code>dataLayer<\/code> object needs to look like. How you end up populating the values into the required keys is up to you, but typically it\u2019s done in one of the following ways:<\/p>\n<ol>\n<li>\n<p>The <code>dataLayer.push()<\/code> is written directly into the page template by whatever server-side mechanism you have for producing the templates.<\/p>\n<\/li>\n<li>\n<p>The <code>dataLayer.push()<\/code> is generated dynamically by your web server or the Ecommerce platform using typically a combination of JavaScript and HTTP requests.<\/p>\n<\/li>\n<li>\n<p>The key-value pairs are populated by scraping the page HTML using Google Tag Manager.<\/p>\n<\/li>\n<\/ol>\n<h3 id=\"populate-the-data-layer\">Populate the Data Layer<\/h3>\n<p>Enhanced Ecommerce requires a <strong>specific syntax<\/strong> for the objects pushed to <code>dataLayer<\/code> or generated with a Custom JavaScript variable. For example, a <code>dataLayer.push()<\/code> with the minimum required Ecommerce object for a <a href=\"#purchase\">Purchase<\/a> looks like this:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer = <span style=\"color:#0aa\">window<\/span>.dataLayer ||\u00a0[];\n<span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  event: <span style=\"color:#a50\">'eec.purchase'<\/span>,\n  ecommerce: {\n    purchase: {\n      actionField: {\n        id: <span style=\"color:#a50\">'1'<\/span>\n      },\n      products: [{\n        id: <span style=\"color:#a50\">'p'<\/span>\n      }]\n    }\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p>Do note that <strong>Google Tag Manager only reacts to <code>dataLayer.push()<\/code> commands<\/strong>. No other array methods will do anything in GTM, so it\u2019s imperative that you do not improvise with this. All the interactions with <code>dataLayer<\/code> must be done with <code>push()<\/code>.<\/p>\n<p>Within the push, all the keys listed under and including <code>ecommerce<\/code> are required. The <code>event<\/code> key is something I <a href=\"https:\/\/www.simoahava.com\/gtm-tips\/add-the-event-key-to-datalayer-pushes\/\">strongly recommend<\/a> to add to every single <code>dataLayer.push()<\/code> object.<\/p>\n<p>Now, you will need to populate the keys in the object with relevant values. For example, the value for <code>ecommerce.purchase.actionField.id<\/code> would need to be a unique identifier of the order itself. You could generate one randomly using JavaScript, but typically you\u2019ll want to use the <strong>same<\/strong> order ID that was included in the actual transaction. That way you can later augment details about this transaction using <a href=\"https:\/\/support.google.com\/analytics\/answer\/3191589?hl=en\">Data Import<\/a>, for example.<\/p>\n<p>Similarly, you\u2019ll need to collect details about the products in the transaction, and send any variant, brand, and category information as metadata, too.<\/p>\n<p>How you do this really depends on what the integration to your Ecommerce system is like. It\u2019s impossible to give generic instructions, because each Ecommerce platform differs in how it provides the values for you to exploit in other on-site code. But if you already have an Ecommerce system in place, I recommend you read through its documentation and try to find out how you can request or access these values and variables from this system.<\/p>\n<h3 id=\"send-the-data-to-google-analytics-using-the-data-layer\">Send the data to Google Analytics using the Data Layer<\/h3>\n<p>When you select the <strong>Use data layer<\/strong> option in the Enhanced Ecommerce settings of a Google Analytics Page View or Event tag (or a <a href=\"https:\/\/www.simoahava.com\/analytics\/google-analytics-settings-variable-in-gtm\/\">Google Analytics Settings variable<\/a>), you instruct the tag to look into the Data Layer and pull the key-value pairs from the <code>ecommerce<\/code> object pushed <strong>most recently<\/strong> into <code>dataLayer<\/code>.<\/p>\n<div style=\"aspect-ratio: 1076 \/ 474;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/use-data-layer.jpg\" title=\"Use Data Layer\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"474\" width=\"1076\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/use-data-layer.jpg#ZgotmplZ\" alt=\"Use Data Layer\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>This sounds pretty straight-forward. All you need to do is make sure the object pushed into <code>dataLayer<\/code> follows the exact correct syntax, and that it\u2019s pushed into <code>dataLayer<\/code> before (or in the same push as) the tag that accesses the data via <strong>Use data layer<\/strong> fires.<\/p>\n<p>However, there are two important things to note here.<\/p>\n<ol>\n<li>\n<p>The <code>dataLayer.push()<\/code> <strong>must<\/strong> be perfectly formed. There\u2019s no way to modify it on-the-go if you activate the \u201cUse data layer\u201d option. So it\u2019s absolutely vital that you specify and audit the object that is being pushed into <code>dataLayer<\/code> for Enhanced Ecommerce data collection.<\/p>\n<\/li>\n<li>\n<p>When a tag with \u201cUse data layer\u201d fires, it really only accesses the <strong>most recent<\/strong> <code>ecommerce<\/code> push. So, if you\u2019ve split Product Impressions into multiple pushes and then fire the tag when the last one is done, if the tag has \u201cUse data layer\u201d checked, only the last impressions object is sent to Google Analytics.<\/p>\n<\/li>\n<\/ol>\n<p>Point (2) might sound counter-intuitive, but it actually makes sense. If GTM didn\u2019t exhibit this behavior, then all <code>ecommerce<\/code> pushes done on a single page would tag along with all the subsequent Enhanced Ecommerce payloads. By sending only the most recently pushed object, this behavior can be avoided.<\/p>\n<p>It\u2019s precisely because of this behavior that I again strongly recommend to <strong>always include the <code>event<\/code> key in every single Enhanced Ecommerce object<\/strong>. Why? Because then you can use <strong>Custom Event triggers<\/strong> to fire your Enhanced Ecommerce tags at precisely the correct time, and the most recent object they access will always be the one that triggered the tag. That way you won\u2019t lose any data because of pushes that didn\u2019t trigger any tags.<\/p>\n<p>However, you might want to take a look at the next section, too.<\/p>\n<h3 id=\"send-the-data-to-google-analytics-using-a-custom-javascript-variable\">Send the data to Google Analytics using a Custom JavaScript variable<\/h3>\n<p>One of my main issues with the <code>dataLayer<\/code> object syntax for Enhanced Ecommerce in Google Tag Manager is its rigidity. The \u201cUse data layer\u201d option requires that you follow a very specific, unwieldy syntax.<\/p>\n<p>This means that it might be a huge effort to get the data into the correct format in the first place. But then you also need to have a process in place so that you can update it with minimal delay, and so that you can audit it to make sure no data is lost.<\/p>\n<p>So, thankfully, Google Tag Manager also lets you send the data using a <a href=\"https:\/\/www.simoahava.com\/analytics\/enhanced-ecommerce-with-a-custom-javascript-variable\/\">Custom JavaScript variable<\/a>.<\/p>\n<div style=\"aspect-ratio: 992 \/ 478;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/custom-js-variable.jpg\" title=\"Custom JavaScript variable\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"478\" width=\"992\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/custom-js-variable.jpg#ZgotmplZ\" alt=\"Custom JavaScript variable\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Using the variable has a very simple logic. All the variable needs to do is <strong>return<\/strong> a valid <code>ecommerce<\/code> object. In other words, the variable needs to return exactly the same thing that the developers would push into <code>dataLayer<\/code> in a perfect world.<\/p>\n<p>And how is this useful? Well, you could have the Ecommerce data pushed into <code>dataLayer<\/code> in <em>any<\/em> format, and then use the Custom JavaScript variable to transform it into a valid <code>ecommerce<\/code> object. This way, you don\u2019t need to confuse matters with a rigid <code>dataLayer<\/code> specification, but rather the Ecommerce platform can push the data into <code>dataLayer<\/code> in whatever format suits it best. Then, with some JavaScript magic, you can pull this data through the Custom JavaScript variable into your tag.<\/p>\n<p>Or, if you want to go the DOM scraping route, you can do all the scraping in the Custom JavaScript variable, and have it return a valid <code>ecommerce<\/code> object with all the key-value pairs in place.<\/p>\n<p>You can also modify a <strong>valid<\/strong> <code>ecommerce<\/code> object in the <code>dataLayer<\/code> in case you need to add some dynamic updates to it (such as Product-scoped Custom Dimensions). For example, here\u2019s me adding a <a href=\"#product-scoped-custom-dimensions-and-metrics\">Product-scoped Custom Dimension<\/a> to all the products in a Purchase object:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#00a\">function<\/span>() {\n  <span style=\"color:#aaa;font-style:italic\">\/\/ Create a copy of the variable to avoid\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#aaa;font-style:italic\">\/\/ modifying the source object by reference\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#00a\">var<\/span> ecom = JSON.parse(JSON.stringify({{Data Layer Variable - ecommerce}}));\n  <span style=\"color:#00a\">try<\/span> {\n    ecom.purchase.products.forEach(<span style=\"color:#00a\">function<\/span>(prod) {\n      prod.dimension10 = {{get discount}}(prod.id);\n    });\n  } <span style=\"color:#00a\">catch<\/span>(e) {}\n  <span style=\"color:#00a\">return<\/span> {\n    ecommerce: ecom\n  };\n}\n<\/code><\/pre>\n<\/div>\n<p>With this simple example, I\u2019m updating a perfectly valid <code>ecommerce<\/code> object (represented by <strong>{{Data Layer Variable &#8211; ecommerce}}<\/strong>), by adding a new field to every single product.<\/p>\n<p>As you can see, I\u2019m making a <strong>copy<\/strong> of the original variable with the <code>JSON.parse(JSON.stringify(obj))<\/code> method. Because JavaScript copies objects by reference, any changes you make to the <code>ecom<\/code> variable would reflect in the original object stored in <code>dataLayer<\/code>. This might have adverse effects if the variable is run more than once, especially if you\u2019re running calculations on any fields (the calculations would be done over and over again).<\/p>\n<p>One additional <strong>important thing to note<\/strong>. Data Layer Variables are, by default, <a href=\"https:\/\/www.simoahava.com\/gtm-tips\/data-layer-variable-versions-explained\/\"><strong>Version 2<\/strong><\/a>. This means that they will merge all the existing <code>ecommerce<\/code> pushes into one big <code>ecommerce<\/code> object. So when you create the variable for <code>ecommerce<\/code>, you might want to use <strong>Version 1<\/strong>. Read <a href=\"https:\/\/www.simoahava.com\/analytics\/enhanced-ecommerce-with-a-custom-javascript-variable\/\">this article<\/a> for more information.<\/p>\n<h3 id=\"page-view-or-event-tag\">Page View or Event tag<\/h3>\n<p>Whether you want to use a Page View or Event tag and how you setup your Custom Event triggers is completely up to you.<\/p>\n<p>Personally, I <strong>always<\/strong> use Event tags. Why? Because if you use a Page View tag, you lack insight into what Enhanced Ecommerce events have been collected in Google Analytics. This might make debugging a broken implementation difficult. By using events, I can always look at the Top Events report to see all the Enhanced Ecommerce hits sent to GA.<\/p>\n<div style=\"aspect-ratio: 1532 \/ 786;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/event-list.jpg\" title=\"Event report\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"786\" width=\"1532\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/event-list.jpg#ZgotmplZ\" alt=\"Event report\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>You can even add things like order ID as the Event Label of these hits, so that you can really start debugging if the event for the order was sent but no transaction was actually received in the Ecommerce reports.<\/p>\n<p>If you do use an Event tag, setting the <code>nonInteraction<\/code> field is, again, up to you. Personally, I set it to <code>true<\/code> when the event is sent with the page load, and <code>false<\/code> in all other instances.<\/p>\n<p>But you do exactly what works best for you. Sometimes you might want to avoid events if you\u2019re approaching the 500 hits per session limit. Not a good reason, but a reason nonetheless.<\/p>\n<h3 id=\"a-word-on-scraping-the-dom\">A word on scraping the DOM<\/h3>\n<p><strong>Scraping the DOM<\/strong> refers to the habit of accessing the dynamic HTML representation of the page (the Document Object Model) directly with JavaScript and populating the Enhanced Ecommerce key-value pairs with values found on the page. On a receipt page, for example, you often see the order ID, the total value of the transaction, all products, shipping costs, and so forth. So you could just as well scrape these from the page rather than going through a complicated specification project with your front-end developers.<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#00a\">function<\/span>() {\n  <span style=\"color:#00a\">var<\/span> orderId = <span style=\"color:#0aa\">document<\/span>.querySelector(<span style=\"color:#a50\">'#order span.id'<\/span>).textContent,\n      revenue = <span style=\"color:#0aa\">document<\/span>.querySelector(<span style=\"color:#a50\">'#order span.total'<\/span>).textContent,\n      products = [].map.call(<span style=\"color:#0aa\">document<\/span>.querySelectorAll(<span style=\"color:#a50\">'#order .product'<\/span>), <span style=\"color:#00a\">function<\/span>(prod) {\n    <span style=\"color:#00a\">return<\/span> {\n      id: prod.getAttribute(<span style=\"color:#a50\">'data-id'<\/span>),\n      name: prod.innerText\n    };\n  });\n  <span style=\"color:#00a\">return<\/span> {\n    ecommerce: {\n      purchase: {\n        actionField: {\n          id: orderId,\n          revenue: revenue\n        },\n        products: products\n      }\n    }\n  };\n}\n<\/code><\/pre>\n<\/div>\n<p>It\u2019s not pretty, and it comes with a lot of baggage and technical debt. For one, you\u2019re introducing a huge weak link in your tracking. If anything changes on the page, e.g. due to an A\/B-test, it\u2019s possible your scraper will break.<\/p>\n<p>Furthermore, it\u2019s fairly common to <strong>not<\/strong> include all details about products on the receipt page. Typically, just the name, ID, price, and tax of the line item is enough. This means you\u2019ll miss all the other vital metadata such as product category, brand, variant, etc.<\/p>\n<p>In other words, scraping might be the easy way to get some data quick, and for that it\u2019s a great tool. But used on its own to carry the data quality of your entire Enhanced Ecommerce process? Not so much.<\/p>\n<h3 id=\"combining-different-data-types-in-a-single-eec-hit\">Combining different data types in a single EEC hit<\/h3>\n<p>Enhanced Ecommerce in Google Tag Manager allows you to send more than one data type in a single Enhanced Ecommerce hit. This is because all the data types are deconstructed into parameters of the Google Analytics request, and as long as each parameter only has a single value, you can combine them to your heart\u2019s content.<\/p>\n<p>However, you can\u2019t combine them in any way you like. The rule of thumb is that each hit can only contain one <a href=\"#data-types-actions\"><strong>Action<\/strong><\/a>, one <a href=\"#data-types-impressions\"><strong>Impression<\/strong><\/a>, and one <a href=\"#data-types-promotions\"><strong>Promotion<\/strong><\/a> object. But it gets a bit more complicated than that, since there are more shared fields between the different data types, invalidating certain combinations. Here are the valid combinations you can send:<\/p>\n<ul>\n<li>\n<p><strong>Impression View<\/strong> with <strong>Promotion View<\/strong> and <strong>Action<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>Impression View<\/strong> with one of <strong>Promotion View<\/strong> or <strong>Action<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>Promotion View<\/strong> with one of <strong>Impression View<\/strong> or <strong>Action<\/strong><\/p>\n<\/li>\n<\/ul>\n<p>See the chapter titled <a href=\"#data-types-actions\"><strong>Data types: Actions<\/strong><\/a> to understand what <strong>Actions<\/strong> comprise. Note that <strong>Impression Click<\/strong> and <strong>Promotion Click<\/strong> are <strong>Actions<\/strong> even if they\u2019re listed in a different chapter (it was more logical to group them with impression and promotion views, respectively).<\/p>\n<p>A typical mistake is to try to send a Product Detail View and a Product Add To Cart in the same push, or a Product Add To Cart and a Product Checkout in the same push. This isn\u2019t valid, since these objects occupy many of the same parameter names (e.g. all the product keys), so by trying to populate them twice in the same hit, you end up making a royal mess of things.<\/p>\n<h3 id=\"product-scoped-custom-dimensions-and-metrics\">Product-scoped Custom Dimensions and Metrics<\/h3>\n<p>With Enhanced Ecommerce, Google Analytics introduced <a href=\"https:\/\/www.simoahava.com\/gtm-tips\/product-scoped-custom-dimensions-and-metrics\/\">Product-scoped Custom Dimensions and Metrics<\/a>. These are extra metadata that can be added directly into the objects within a <code>products<\/code> array.<\/p>\n<p>The <code>dataLayer<\/code> syntax is, again, fairly rigid. They <strong>must<\/strong> be named <code>dimensionN<\/code> and <code>metricN<\/code> (where <code>N<\/code> is the index number), and they must be embedded in the product object that is included in the <code>products<\/code> array. For example, this is a valid way to send a Product-scoped Custom Dimension into index 5:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\">{\n  ecommerce: {\n    purchase: {\n      actionField: {\n        id: <span style=\"color:#a50\">'t1'<\/span>\n      },\n      products: [{\n        id: <span style=\"color:#a50\">'p1'<\/span>,\n        dimension5: <span style=\"color:#a50\">'Black'<\/span> <span style=\"color:#aaa;font-style:italic\">\/\/ Product-scoped Custom Dimension in index 5\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>      }]\n    }\n  }\n}\n<\/code><\/pre>\n<\/div>\n<p>As you can see, <code>dimension5<\/code> is in the object within in the <code>products<\/code> array.<\/p>\n<p>Because of this rather rigid way of adding the dimensions and metrics, I suggest taking a look at the <a href=\"#send-the-data-to-google-analytics-using-a-custom-javascript-variable\">Custom JavaScript variable<\/a> option for mutating the object pushed into <code>dataLayer<\/code> into a valid Enhanced Ecommerce object.<\/p>\n<h3 id=\"the-product-list\">The Product List<\/h3>\n<p><strong>Product List<\/strong> is a very important attribute in Enhanced Ecommerce tracking. For one, it\u2019s really one of the only places in Enhanced Ecommerce where some sort of <a href=\"https:\/\/www.simoahava.com\/analytics\/attribution-enhanced-ecommerce-reports\/\">attribution<\/a> takes place. But also, it\u2019s a great way to look at how different parts of the site contribute to the success of your ecommerce efforts.<\/p>\n<p>The Product List is a key that you can add into the <code>actionField<\/code> object of all Action data types. You can also add it to <a href=\"#impression-views\">Impression View<\/a> objects directly.<\/p>\n<p>The <strong>attribution<\/strong> works in a very specific way. When you send the <code>list<\/code> attribute in one of your Enhanced Ecommerce actions or impressions, then after that every single subsequent Enhanced Ecommerce action will be credited to that list <strong>as long as the product IDs in those subsequent actions match those of the one where you sent the list<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1666 \/ 862;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2016\/07\/list-attribution.jpg\" title=\"attribution in list\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"862\" width=\"1666\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2016\/07\/list-attribution.jpg#ZgotmplZ\" alt=\"attribution in list\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>In other words, if you send a Product Detail View for a product with ID <code>123<\/code>, and you use the list value \u201cdiscount\u201d, then every single subsequent Enhanced Ecommerce action for a product with ID <code>123<\/code> within that session will be attributed to that list.<\/p>\n<p>As soon as the Product ID changes or you send some other <code>list<\/code> value, this funnel will break and a new one will start.<\/p>\n<p>You\u2019ll also see plenty of <code>(not set)<\/code> product lists in your reports. This is due to sessions expiring and new ones starting without any Product List information. Naturally, if your funnel doesn\u2019t include a Product List for all possible interactions, you\u2019ll see <code>(not set)<\/code> due to this, too.<\/p>\n<p>Do note that attribution is always <strong>session-scoped<\/strong>, so if the session timeout is reached or the session is broken for some other reason, attribution will break, too.<\/p>\n<p>If this sounds confusing, please read my <a href=\"https:\/\/www.simoahava.com\/analytics\/attribution-enhanced-ecommerce-reports\/\">article on the topic<\/a>.<\/p>\n<h3 id=\"local-currency\">Local Currency<\/h3>\n<p>If visitors to your site can choose to shop with different currencies, you can utilize Google Analytics\u2019 Local Currency feature to normalize these values once they hit your GA reports. All you need to do is specify the <a href=\"https:\/\/support.google.com\/analytics\/answer\/6205902?hl=en\">currency code<\/a> either directly in the <code>dataLayer<\/code> object, or as a field in the tag which sends the Enhanced Ecommerce data to GA.<\/p>\n<p>For example, here\u2019s what a <code>dataLayer.push()<\/code> for a purchase made with Euros would look like:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer = <span style=\"color:#0aa\">window<\/span>.dataLayer || [];\n<span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  event: <span style=\"color:#a50\">'eec.purchase'<\/span>,\n  ecommerce: {\n    currencyCode: <span style=\"color:#a50\">'EUR'<\/span>,\n    purchase: {\n      actionField: {\n        id: <span style=\"color:#a50\">'order_id'<\/span>,\n        revenue: <span style=\"color:#a50\">'11.00'<\/span>\n      },\n      products: [{\n        id: <span style=\"color:#a50\">'product_id'<\/span>,\n        price: <span style=\"color:#a50\">'11.00'<\/span>,\n        quantity: <span style=\"color:#099\">1<\/span>\n      }]\n    }\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p>Note that if you use a local currency, remember to set keys like <code>revenue<\/code> and <code>price<\/code> in that local currency (so no need to do any conversions in the client).<\/p>\n<p>GA will then convert these local currencies to whatever currency you have configured in the Google Analytics view.<\/p>\n<p>If you want to add this currency code as a field in the tag (or Google Analytics Settings variable), you can add it by browsing to <strong>Fields to Set<\/strong>, and adding a new field:<\/p>\n<p><strong>Field name<\/strong>: currencyCode<br \/><strong>Value<\/strong>: EUR<\/p>\n<p>Instead of \u201cEUR\u201d, you can use a variable that pulls the currency code from e.g. the Data Layer or a browser cookie.<\/p>\n<h2 id=\"remember-be-consistent\">Remember: be consistent<\/h2>\n<p>One very important thing about Enhanced Ecommerce is that it\u2019s (mostly) hit-scoped. The only exception is the minimal attribution with Product Lists and promotions.<\/p>\n<p>In other words, if you send a Product Category of <code>T-Shirt<\/code> with a product in a Product Detail View, that information will only be available to queries involving Product Detail Views and that particular product. Nothing carries over or persists to the subsequent hits.<\/p>\n<p>You\u2019ll need to include <strong>all metadata<\/strong> about <strong>all products and all actions<\/strong> in <strong>all Enhanced Ecommerce objects<\/strong>.<\/p>\n<div style=\"aspect-ratio: 2378 \/ 326;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/category-broken.jpg\" title=\"Category broken attribution\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"326\" width=\"2378\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/category-broken.jpg#ZgotmplZ\" alt=\"Category broken attribution\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>This is one of the reasons why DOM scraping is not a good idea. It\u2019s rare to see the same information on every single page where you have Enhanced Ecommerce actions.<\/p>\n<p>This is also one of the reasons why implementing Enhanced Ecommerce might be a headache to developers. It\u2019s possible that the different parts of the funnel are governed by different systems. For example, a fairly typical CMS setup could handle Product Detail Views, but then cart additions are done using a SaaS cart service, checkout is done using PayPal, and purchase receipt page is yet another system.<\/p>\n<p>In order to persist all product data from one page to another, you might need to introduce client-side persistence using <a href=\"https:\/\/www.simoahava.com\/analytics\/two-ways-to-persist-data-via-google-tag-manager\/\">cookies or browser storage<\/a>, for example.<\/p>\n<h2 id=\"data-types-actions\">Data types: Actions<\/h2>\n<p><strong>Actions<\/strong> are Enhanced Ecommerce events that include some type of user-initiated action. This isn\u2019t always a clear definition, and e.g. Product Detail Views could arguably not be user-initiated actions. But that\u2019s the definition that Google uses.<\/p>\n<p>The following chapters will depict what the <code>dataLayer<\/code> object for each action should look like, and what a typical tag\/trigger combination would be.<\/p>\n<h3 id=\"product-detail-views\">Product Detail Views<\/h3>\n<p>Product Detail Views are typically sent when the <strong>user views details about a product<\/strong>. This is, again typically, on a dedicated product page, but it could just as well be expanded content in a search results list, or something else.<\/p>\n<h4 id=\"data-layer-composition\">Data Layer composition<\/h4>\n<p>Available fields in the <code>ecommerce<\/code> object:<\/p>\n<table>\n<thead>\n<tr>\n<th>Key<\/th>\n<th>Type<\/th>\n<th>Example<\/th>\n<th>Comment<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>actionField.list<\/code><\/td>\n<td>String<\/td>\n<td><code>'Expanded content'<\/code><\/td>\n<td>Where the Product Detail View occurred. Useful if you want to see how different \u201clists\u201d contribute to funnel success.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].id<\/code><\/td>\n<td>String<\/td>\n<td><code>'P12345'<\/code><\/td>\n<td>The SKU of the product. I recommend sending any variant IDs using a Product-scoped Custom Dimension.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].name<\/code><\/td>\n<td>String<\/td>\n<td><code>'T-Shirt'<\/code><\/td>\n<td>The name of the product. Any variant name can be sent with the <code>variant<\/code> key.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].category<\/code><\/td>\n<td>String<\/td>\n<td><code>'clothes\/shirts\/t-shirts'<\/code><\/td>\n<td>Product category of the item. Can have maximum five levels of hierarchy.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].variant<\/code><\/td>\n<td>String<\/td>\n<td><code>'Large'<\/code><\/td>\n<td>What variant of the main product this is.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].brand<\/code><\/td>\n<td>String<\/td>\n<td><code>'NIKE'<\/code><\/td>\n<td>The brand name of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].dimensionN<\/code><\/td>\n<td>String<\/td>\n<td><code>'Blue'<\/code><\/td>\n<td>A Product-scoped Custom Dimension for index number N.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].metricN<\/code><\/td>\n<td>Integer<\/td>\n<td><code>3<\/code><\/td>\n<td>A Product-scoped Custom Metric for index number N.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This is what the <code>dataLayer.push()<\/code> for a Product Detail View would look like with all the <strong>relevant<\/strong> keys populated:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer = <span style=\"color:#0aa\">window<\/span>.dataLayer || [];\n<span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  event: <span style=\"color:#a50\">'eec.detail'<\/span>,\n  ecommerce: {\n    detail: {\n      actionField: {\n        list: <span style=\"color:#a50\">'Search Results'<\/span>\n      },\n      products: [{\n        id: <span style=\"color:#a50\">'product_id'<\/span>,\n        name: <span style=\"color:#a50\">'MY PRODUCT'<\/span>,\n        category: <span style=\"color:#a50\">'guides\/google-tag-manager\/enhanced-ecommerce'<\/span>,\n        variant: <span style=\"color:#a50\">'Text'<\/span>,\n        brand: <span style=\"color:#a50\">'SIMO AHAVA'<\/span>,\n        dimension3: <span style=\"color:#a50\">'Ecommerce'<\/span>,\n        metric5: <span style=\"color:#099\">12<\/span>,\n        metric6: <span style=\"color:#099\">1002<\/span>\n      }]\n    }\n  }\n});\n<\/code><\/pre>\n<\/div>\n<blockquote>\n<p>Remember, if you want to use a Custom JavaScript variable instead, the variable must return the <code>ecommerce<\/code> object from the <code>dataLayer.push()<\/code> above.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-example\">Tag configuration example<\/h4>\n<p>Typical <strong>Event tag<\/strong>:<\/p>\n<div style=\"aspect-ratio: 1934 \/ 1866;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/product-detail-view-tag.jpg\" title=\"Product Detail View tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1866\" width=\"1934\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/product-detail-view-tag.jpg#ZgotmplZ\" alt=\"Product Detail View tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The <strong>trigger<\/strong> would be a <strong>Custom Event trigger<\/strong> with the following setting:<\/p>\n<p><strong>Event name<\/strong>: <code>eec.detail<\/code><\/p>\n<h3 id=\"add-to-cart\">Add to Cart<\/h3>\n<p>The Add to Cart hit is sent whenever a product (or products) are added to cart. The <code>quantity<\/code> of each product needs to reflect the number of items that were <strong>added<\/strong> to the cart in this action, and not the final tally of each item in the cart.<\/p>\n<h4 id=\"data-layer-composition-1\">Data Layer composition<\/h4>\n<p>Available fields in the <code>ecommerce<\/code> object:<\/p>\n<table>\n<thead>\n<tr>\n<th>Key<\/th>\n<th>Type<\/th>\n<th>Example<\/th>\n<th>Comment<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>actionField.list<\/code><\/td>\n<td>String<\/td>\n<td><code>'Search results'<\/code><\/td>\n<td>Where the Add to Cart happened. If there are multiple places on the site where products can be added to cart, it\u2019s a good idea to differentiate between them using the Product List attribute.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].id<\/code><\/td>\n<td>String<\/td>\n<td><code>'P12345'<\/code><\/td>\n<td>The SKU of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].name<\/code><\/td>\n<td>String<\/td>\n<td><code>'T-Shirt'<\/code><\/td>\n<td>The name of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].category<\/code><\/td>\n<td>String<\/td>\n<td><code>'clothes\/shirts\/t-shirts'<\/code><\/td>\n<td>Product category of the item. Can have maximum five levels of hierarchy.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].variant<\/code><\/td>\n<td>String<\/td>\n<td><code>'Large'<\/code><\/td>\n<td>What variant of the main product this is.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].brand<\/code><\/td>\n<td>String<\/td>\n<td><code>'NIKE'<\/code><\/td>\n<td>The brand name of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].quantity<\/code><\/td>\n<td>Integer<\/td>\n<td><code>1<\/code><\/td>\n<td>The quantity of this product added to cart.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].dimensionN<\/code><\/td>\n<td>String<\/td>\n<td><code>'Blue'<\/code><\/td>\n<td>A Product-scoped Custom Dimension for index number N.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].metricN<\/code><\/td>\n<td>Integer<\/td>\n<td><code>3<\/code><\/td>\n<td>A Product-scoped Custom Metric for index number N.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This is what the <code>dataLayer.push()<\/code> for an Add to Cart would look like with all the <strong>relevant<\/strong> keys populated:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer = <span style=\"color:#0aa\">window<\/span>.dataLayer || [];\n<span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  event: <span style=\"color:#a50\">'eec.add'<\/span>,\n  ecommerce: {\n    add: {\n      actionField: {\n        list: <span style=\"color:#a50\">'Shopping cart'<\/span>\n      },\n      products: [{\n        id: <span style=\"color:#a50\">'product_id'<\/span>,\n        name: <span style=\"color:#a50\">'MY PRODUCT'<\/span>,\n        category: <span style=\"color:#a50\">'guides\/google-tag-manager\/enhanced-ecommerce'<\/span>,\n        variant: <span style=\"color:#a50\">'Text'<\/span>,\n        brand: <span style=\"color:#a50\">'SIMO AHAVA'<\/span>,\n        quantity: <span style=\"color:#099\">2<\/span>,\n        dimension3: <span style=\"color:#a50\">'Ecommerce'<\/span>,\n        metric5: <span style=\"color:#099\">12<\/span>,\n        metric6: <span style=\"color:#099\">1002<\/span>\n      },{\n        id: <span style=\"color:#a50\">'another_product_id'<\/span>,\n        name: <span style=\"color:#a50\">'MY ADD-ON'<\/span>,\n        quantity: <span style=\"color:#099\">1<\/span>\n      }]\n    }\n  }\n});\n<\/code><\/pre>\n<\/div>\n<blockquote>\n<p>Remember, if you want to use a Custom JavaScript variable instead, the variable must return the <code>ecommerce<\/code> object from the <code>dataLayer.push()<\/code> above.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-example-1\">Tag configuration example<\/h4>\n<p>Typical <strong>Event tag<\/strong>:<\/p>\n<div style=\"aspect-ratio: 1880 \/ 1868;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/add-to-cart-tag.jpg\" title=\"Add To Cart tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1868\" width=\"1880\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/add-to-cart-tag.jpg#ZgotmplZ\" alt=\"Add To Cart tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The variable in <strong>Event Label<\/strong> is a Data Layer Variable that points to <code>ecommerce.add.actionField.list<\/code>. This returns the Product List of the hit, if any.<\/p>\n<p>The <strong>trigger<\/strong> would be a <strong>Custom Event trigger<\/strong> with the following setting:<\/p>\n<p><strong>Event name<\/strong>: <code>eec.add<\/code><\/p>\n<h3 id=\"remove-from-cart\">Remove from Cart<\/h3>\n<p>Remove from Cart is what you would send when items are removed from the cart. The <code>quantity<\/code> you send for each item needs to reflect the quantity that was removed in the action, and not the quantity of items remaining in the cart.<\/p>\n<h4 id=\"data-layer-composition-2\">Data Layer composition<\/h4>\n<p>The Data Layer composition for Remove from Cart is identical to that of Add to Cart.<\/p>\n<p>Similarly, the <code>dataLayer.push()<\/code> example would be identical, except the first key under <code>ecommerce<\/code> is named <code>remove<\/code> rather than <code>add<\/code>, and the event name is different:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer = <span style=\"color:#0aa\">window<\/span>.dataLayer || [];\n<span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  event: <span style=\"color:#a50\">'eec.remove'<\/span>,\n  ecommerce: {\n    remove: {\n      actionField: {...},\n      products: [...]\n    }\n  }\n});\n<\/code><\/pre>\n<\/div>\n<blockquote>\n<p>Remember, if you want to use a Custom JavaScript variable instead, the variable must return the <code>ecommerce<\/code> object from the <code>dataLayer.push()<\/code> above.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-example-2\">Tag configuration example<\/h4>\n<p>Typical <strong>Event tag<\/strong>:<\/p>\n<div style=\"aspect-ratio: 923 \/ 925;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/remove-from-cart-tag.jpg\" title=\"Remove from cart tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"925\" width=\"923\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/remove-from-cart-tag.jpg#ZgotmplZ\" alt=\"Remove from cart tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The variable in <strong>Event Label<\/strong> is a Data Layer Variable that points to <code>ecommerce.remove.actionField.list<\/code>. This returns the Product List of the hit, if any.<\/p>\n<p>The <strong>trigger<\/strong> would be a <strong>Custom Event trigger<\/strong> with the following setting:<\/p>\n<p><strong>Event name<\/strong>: <code>eec.remove<\/code><\/p>\n<h3 id=\"checkout\">Checkout<\/h3>\n<p>A Checkout is sent when the user enters the checkout funnel. For every discrete <strong>step<\/strong> in the funnel, you send a checkout hit to GA. Steps are typically pages (on a multi-page checkout) or sections of the form (on a single-page checkout).<\/p>\n<p>The <code>products<\/code> array should only be sent <strong>with the first step<\/strong>. Sending it with any other step will do nothing.<\/p>\n<p>You can also add an <code>option<\/code> key to the checkout hit, in case you want to send extra details about the checkout step itself (such as selected payment method or shipment method). Alternatively, you can use the Checkout Option action to send the option information after the step has first been sent-<\/p>\n<h4 id=\"data-layer-composition-3\">Data Layer composition<\/h4>\n<p>Available fields in the <code>ecommerce<\/code> object:<\/p>\n<table>\n<thead>\n<tr>\n<th>Key<\/th>\n<th>Type<\/th>\n<th>Example<\/th>\n<th>Comment<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>actionField.step<\/code><\/td>\n<td>Integer<\/td>\n<td><code>1<\/code><\/td>\n<td>The number of the checkout step. These should be sent in order, where the first step is 1. You can define what these steps mean in the Google Analytics Admin user interface.<\/td>\n<\/tr>\n<tr>\n<td><code>actionField.option<\/code><\/td>\n<td>String<\/td>\n<td><code>'Visa'<\/code><\/td>\n<td>You can send the <code>option<\/code> key if there is extra metadata (e.g. shipping or payment method) you want to send with the step hit itself.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].id<\/code><\/td>\n<td>String<\/td>\n<td><code>'P12345'<\/code><\/td>\n<td>The SKU of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].name<\/code><\/td>\n<td>String<\/td>\n<td><code>'T-Shirt'<\/code><\/td>\n<td>The name of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].category<\/code><\/td>\n<td>String<\/td>\n<td><code>'clothes\/shirts\/t-shirts'<\/code><\/td>\n<td>Product category of the item. Can have maximum five levels of hierarchy.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].variant<\/code><\/td>\n<td>String<\/td>\n<td><code>'Large'<\/code><\/td>\n<td>What variant of the main product this is.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].brand<\/code><\/td>\n<td>String<\/td>\n<td><code>'NIKE'<\/code><\/td>\n<td>The brand name of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].quantity<\/code><\/td>\n<td>Number<\/td>\n<td><code>3<\/code><\/td>\n<td>The quantity of the given product checked out.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].dimensionN<\/code><\/td>\n<td>String<\/td>\n<td><code>'Blue'<\/code><\/td>\n<td>A Product-scoped Custom Dimension for index number N.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].metricN<\/code><\/td>\n<td>Integer<\/td>\n<td><code>3<\/code><\/td>\n<td>A Product-scoped Custom Metric for index number N.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This is what the <code>dataLayer.push()<\/code> for <strong>the first Checkout step<\/strong> would look like with all the <strong>relevant<\/strong> keys populated:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer = <span style=\"color:#0aa\">window<\/span>.dataLayer || [];\n<span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  event: <span style=\"color:#a50\">'eec.checkout'<\/span>,\n  ecommerce: {\n    checkout: {\n      actionField: {\n        step: <span style=\"color:#099\">1<\/span>\n      },\n      products: [{\n        id: <span style=\"color:#a50\">'product_id'<\/span>,\n        name: <span style=\"color:#a50\">'MY PRODUCT'<\/span>,\n        category: <span style=\"color:#a50\">'guides\/google-tag-manager\/enhanced-ecommerce'<\/span>,\n        variant: <span style=\"color:#a50\">'Text'<\/span>,\n        brand: <span style=\"color:#a50\">'SIMO AHAVA'<\/span>,\n        quantity: <span style=\"color:#099\">2<\/span>,\n        dimension3: <span style=\"color:#a50\">'Ecommerce'<\/span>,\n        metric5: <span style=\"color:#099\">12<\/span>,\n        metric6: <span style=\"color:#099\">1002<\/span>\n      },{\n        id: <span style=\"color:#a50\">'another_product_id'<\/span>,\n        name: <span style=\"color:#a50\">'MY ADD-ON'<\/span>,\n        quantity: <span style=\"color:#099\">1<\/span>\n      }]\n    }\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p>The <code>dataLayer.push()<\/code> for <strong>the second Checkout step<\/strong> where you also send the payment method would look like this:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer = <span style=\"color:#0aa\">window<\/span>.dataLayer || [];\n<span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  event: <span style=\"color:#a50\">'eec.checkout'<\/span>,\n  ecommerce: {\n    checkout: {\n      actionField: {\n        step: <span style=\"color:#099\">2<\/span>,\n        option: <span style=\"color:#a50\">'MasterCard'<\/span>\n      }\n    }\n  }\n});\n<\/code><\/pre>\n<\/div>\n<blockquote>\n<p>Remember, if you want to use a Custom JavaScript variable instead, the variable must return the <code>ecommerce<\/code> object from the <code>dataLayer.push()<\/code> above.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-example-3\">Tag configuration example<\/h4>\n<p>Typical <strong>Event tag<\/strong>:<\/p>\n<div style=\"aspect-ratio: 944 \/ 937;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/checkout-tag.jpg\" title=\"Checkout tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"937\" width=\"944\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/checkout-tag.jpg#ZgotmplZ\" alt=\"Checkout tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The variables {{checkout step}} and {{checkout option}} are Data Layer variables for <code>ecommerce.checkout.actionField.step<\/code> and <code>ecommerce.checkout.actionField.option<\/code>, respectively. They return the corresponding values from the checkout hit.<\/p>\n<p>The <strong>trigger<\/strong> would be a <strong>Custom Event trigger<\/strong> with the following setting:<\/p>\n<p><strong>Event name<\/strong>: <code>eec.checkout<\/code><\/p>\n<h3 id=\"checkout-option\">Checkout option<\/h3>\n<p>A Checkout option hit is always sent <strong>after the corresponding Checkout Step has already been sent<\/strong>. So you can\u2019t send a Checkout option hit for step 2 if you haven\u2019t first sent a regular Checkout hit for step 2.<\/p>\n<p>Use the Checkout option hit to send extra information about a checkout step. For example, if Checkout step 2 is where the user chooses the payment method, you\u2019ll want to send Checkout step 2 when the user first lands on the payment method selection page, and then the Checkout option hit after they\u2019ve clicked or selected the payment method.<\/p>\n<h4 id=\"data-layer-composition-4\">Data Layer composition<\/h4>\n<p>The <code>dataLayer.push()<\/code> is very simple. In <code>actionField<\/code>, you indicate with <code>step<\/code> to which Checkout step this option should be attached (Integer), and <code>option<\/code> is the option value itself.<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer = <span style=\"color:#0aa\">window<\/span>.dataLayer || [];\n<span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  event: <span style=\"color:#a50\">'eec.checkout_option'<\/span>,\n  ecommerce: {\n    checkout_option: {\n      actionField: {\n        step: <span style=\"color:#099\">2<\/span>,\n        option: <span style=\"color:#a50\">'Expedited delivery'<\/span>\n      }\n    }\n  }\n});\n<\/code><\/pre>\n<\/div>\n<blockquote>\n<p>Remember, if you want to use a Custom JavaScript variable instead, the variable must return the <code>ecommerce<\/code> object from the <code>dataLayer.push()<\/code> above.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-example-4\">Tag configuration example<\/h4>\n<p>Typical <strong>Event tag<\/strong>:<\/p>\n<div style=\"aspect-ratio: 924 \/ 934;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/checkout-option-tag.jpg\" title=\"Checkout option tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"934\" width=\"924\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/checkout-option-tag.jpg#ZgotmplZ\" alt=\"Checkout option tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The <strong>trigger<\/strong> would be a <strong>Custom Event trigger<\/strong> with the following setting:<\/p>\n<p><strong>Event name<\/strong>: <code>eec.checkout_option<\/code><\/p>\n<h3 id=\"purchase\">Purchase<\/h3>\n<p>The Purchase hit is, arguably, the most important hit in the Enhanced Ecommerce funnel. Without a reliable Purchase hit being collected, all the funnels, attribution models, goal values, conversion calculations, and transaction data become fairly unusable.<\/p>\n<p>In other words, make sure most of the resources is invested in getting the Purchase hit right.<\/p>\n<h4 id=\"data-layer-composition-5\">Data Layer composition<\/h4>\n<p>Available fields in the <code>ecommerce<\/code> object:<\/p>\n<table>\n<thead>\n<tr>\n<th>Key<\/th>\n<th>Type<\/th>\n<th>Example<\/th>\n<th>Comment<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>actionField.id<\/code><\/td>\n<td>String<\/td>\n<td><code>order_12345<\/code><\/td>\n<td>The unique order ID of the transaction. Should match the actual ID of the order.<\/td>\n<\/tr>\n<tr>\n<td><code>actionField.affiliation<\/code><\/td>\n<td>String<\/td>\n<td><code>'Simo Shop'<\/code><\/td>\n<td>Extra details about where the purchase happened.<\/td>\n<\/tr>\n<tr>\n<td><code>actionField.revenue<\/code><\/td>\n<td>String<\/td>\n<td><code>'11.00'<\/code><\/td>\n<td>Total transaction value. You can include tax and shipping, or you can choose to send the revenue without tax and shipping. The value <strong>must not<\/strong> include anything else except number separated by a decimal point. Don\u2019t use a comma as the separator, and don\u2019t include any currency symbols.<\/td>\n<\/tr>\n<tr>\n<td><code>actionField.tax<\/code><\/td>\n<td>String<\/td>\n<td><code>'1.00'<\/code><\/td>\n<td>Tax paid. Same formatting instructions as with revenue.<\/td>\n<\/tr>\n<tr>\n<td><code>actionField.shipping<\/code><\/td>\n<td>String<\/td>\n<td><code>'2.00'<\/code><\/td>\n<td>Cost of shipping. Same formatting instructions as with revenue.<\/td>\n<\/tr>\n<tr>\n<td><code>actionField.coupon<\/code><\/td>\n<td>String<\/td>\n<td><code>'SUMMER2019'<\/code><\/td>\n<td>The coupon code that was used for the entire transaction.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].id<\/code><\/td>\n<td>String<\/td>\n<td><code>'P12345'<\/code><\/td>\n<td>The SKU of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].name<\/code><\/td>\n<td>String<\/td>\n<td><code>'T-Shirt'<\/code><\/td>\n<td>The name of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].category<\/code><\/td>\n<td>String<\/td>\n<td><code>'clothes\/shirts\/t-shirts'<\/code><\/td>\n<td>Product category of the item. Can have maximum five levels of hierarchy.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].variant<\/code><\/td>\n<td>String<\/td>\n<td><code>'Large'<\/code><\/td>\n<td>What variant of the main product this is.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].brand<\/code><\/td>\n<td>String<\/td>\n<td><code>'NIKE'<\/code><\/td>\n<td>The brand name of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].quantity<\/code><\/td>\n<td>Number<\/td>\n<td><code>3<\/code><\/td>\n<td>The quantity of the given product purchased.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].price<\/code><\/td>\n<td>String<\/td>\n<td><code>'10.00'<\/code><\/td>\n<td>The price of one item. Same formatting instructions as with revenue.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].coupon<\/code><\/td>\n<td>String<\/td>\n<td><code>'SHIRTSOFF'<\/code><\/td>\n<td>The coupon code used for this particular product.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].dimensionN<\/code><\/td>\n<td>String<\/td>\n<td><code>'Blue'<\/code><\/td>\n<td>A Product-scoped Custom Dimension for index number N.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].metricN<\/code><\/td>\n<td>Integer<\/td>\n<td><code>3<\/code><\/td>\n<td>A Product-scoped Custom Metric for index number N.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This is what the <code>dataLayer.push()<\/code> for a Purchase hit would look like with all the <strong>relevant<\/strong> keys populated:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer = <span style=\"color:#0aa\">window<\/span>.dataLayer || [];\n<span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  event: <span style=\"color:#a50\">'eec.purchase'<\/span>,\n  ecommerce: {\n    currencyCode: <span style=\"color:#a50\">'EUR'<\/span>,\n    purchase: {\n      actionField: {\n        id: <span style=\"color:#a50\">'ORDER12345'<\/span>,\n        affiliation: <span style=\"color:#a50\">'Simo\\'s shop'<\/span>,\n        revenue: <span style=\"color:#a50\">'11.00'<\/span>,\n        tax: <span style=\"color:#a50\">'1.00'<\/span>,\n        shipping: <span style=\"color:#a50\">'2.00'<\/span>,\n        coupon: <span style=\"color:#a50\">'SUMMER2019'<\/span>\n      },\n      products: [{\n        id: <span style=\"color:#a50\">'product_id'<\/span>,\n        name: <span style=\"color:#a50\">'MY PRODUCT'<\/span>,\n        category: <span style=\"color:#a50\">'guides\/google-tag-manager\/enhanced-ecommerce'<\/span>,\n        variant: <span style=\"color:#a50\">'Text'<\/span>,\n        brand: <span style=\"color:#a50\">'SIMO AHAVA'<\/span>,\n        quantity: <span style=\"color:#099\">2<\/span>,\n        price: <span style=\"color:#a50\">'3.50'<\/span>,\n        dimension3: <span style=\"color:#a50\">'Ecommerce'<\/span>,\n        metric5: <span style=\"color:#099\">12<\/span>,\n        metric6: <span style=\"color:#099\">1002<\/span>\n      },{\n        id: <span style=\"color:#a50\">'another_product_id'<\/span>,\n        name: <span style=\"color:#a50\">'MY ADD-ON'<\/span>,\n        price: <span style=\"color:#a50\">'1.00'<\/span>,\n        quantity: <span style=\"color:#099\">1<\/span>,\n        coupon: <span style=\"color:#a50\">'ADD-ONS OFF'<\/span>\n      }]\n    }\n  }\n});\n<\/code><\/pre>\n<\/div>\n<blockquote>\n<p>Remember, if you want to use a Custom JavaScript variable instead, the variable must return the <code>ecommerce<\/code> object from the <code>dataLayer.push()<\/code> above.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-example-5\">Tag configuration example<\/h4>\n<p>Typical <strong>Event tag<\/strong>:<\/p>\n<div style=\"aspect-ratio: 923 \/ 929;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/purchase-tag.jpg\" title=\"Purchase tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"929\" width=\"923\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/purchase-tag.jpg#ZgotmplZ\" alt=\"Purchase tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The variable {{order id}} is a Data Layer variable for <code>ecommerce.purchase.actionField.id<\/code>, and it returns the transaction ID. The variable {{revenue}} is a Data Layer variable for <code>ecommerce.purchase.actionField.revenue<\/code>, and it returns the revenue of the transaction.<\/p>\n<p>The <strong>trigger<\/strong> would be a <strong>Custom Event trigger<\/strong> with the following setting:<\/p>\n<p><strong>Event name<\/strong>: <code>eec.purchase<\/code><\/p>\n<h3 id=\"refund\">Refund<\/h3>\n<p>The Refund hit should be sent if the user requests a refund of the product through the website.<\/p>\n<p>Important: <strong>this does NOT remove the original transaction or negate it in any way<\/strong>. The Refund hit is a hit of its own, and will be used to populate metrics like \u201cRefund Amount\u201d and \u201cProduct Refund Amount\u201d. This makes the Refund hit type fairly useless, in my opinion, but it might have its uses if you simply want to know whether refunds are requested via the website.<\/p>\n<h4 id=\"data-layer-composition-6\">Data Layer composition<\/h4>\n<p>Available fields in the <code>ecommerce<\/code> object:<\/p>\n<table>\n<thead>\n<tr>\n<th>Key<\/th>\n<th>Type<\/th>\n<th>Example<\/th>\n<th>Comment<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>actionField.id<\/code><\/td>\n<td>String<\/td>\n<td><code>order_12345<\/code><\/td>\n<td>If the user requested a <strong>full refund<\/strong> of the order, then you <strong>only<\/strong> need to send the transaction ID with the hit.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].id<\/code><\/td>\n<td>String<\/td>\n<td><code>'P12345'<\/code><\/td>\n<td>If the user only wanted a refund for some items, you need to also send the <code>id<\/code> of each along with the quantity refunded.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].quantity<\/code><\/td>\n<td>Number<\/td>\n<td><code>3<\/code><\/td>\n<td>The quantity of the given item refunded.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This is what the <code>dataLayer.push()<\/code> would look like for a completely refunded transaction:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer = <span style=\"color:#0aa\">window<\/span>.dataLayer || [];\n<span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  event: <span style=\"color:#a50\">'eec.refund'<\/span>,\n  ecommerce: {\n    refund: {\n      actionField: {\n        id: <span style=\"color:#a50\">'ORDER12345'<\/span>\n      }\n    }\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p>This is what the <code>dataLayer.push()<\/code> would look like for a partially refunded transaction:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer = <span style=\"color:#0aa\">window<\/span>.dataLayer || [];\n<span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  event: <span style=\"color:#a50\">'eec.refund'<\/span>,\n  ecommerce: {\n    refund: {\n      actionField: {\n        id: <span style=\"color:#a50\">'ORDER12345'<\/span>\n      }, \n      products: [{\n        id: <span style=\"color:#a50\">'another_product_id'<\/span>,\n        quantity: <span style=\"color:#099\">1<\/span>\n      }]\n    }\n  }\n});\n<\/code><\/pre>\n<\/div>\n<blockquote>\n<p>Remember, if you want to use a Custom JavaScript variable instead, the variable must return the <code>ecommerce<\/code> object from the <code>dataLayer.push()<\/code> above.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-example-6\">Tag configuration example<\/h4>\n<p>Typical <strong>Event tag<\/strong>:<\/p>\n<div style=\"aspect-ratio: 964 \/ 933;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/refund-tag.jpg\" title=\"refund tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"933\" width=\"964\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/refund-tag.jpg#ZgotmplZ\" alt=\"refund tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The variable {{order id}} returns the transaction ID that was refunded. The variable {{total quantity refunded}} is a Custom JavaScript variable which returns the total quantity of all items that were refunded.<\/p>\n<p>The <strong>trigger<\/strong> would be a <strong>Custom Event trigger<\/strong> with the following setting:<\/p>\n<p><strong>Event name<\/strong>: <code>eec.refund<\/code><\/p>\n<h2 id=\"data-types-impressions\">Data types: Impressions<\/h2>\n<p><strong>Impressions<\/strong> are what you send when the user sees a listing of products in a Search Results page, for example. Basically, wherever you show a listing of products without going into enough detail for that to count as a Product Detail View, use impressions.<\/p>\n<p>Impressions comprise of a \u201cview\u201d, where the user sees the product in a listing, and a \u201cclick\u201d, where the user clicks a product in the listing (to go to its Product Detail page, for example).<\/p>\n<p>Note that you might be tempted to send <strong>all the products on the listing page<\/strong> as impressions in a single hit. This might get you into trouble with Google Analytics\u2019 maximum payload size of 8KB (that\u2019s typically around 30-50 product impressions). To avoid this, you can do a number of things, such as <a href=\"https:\/\/www.simoahava.com\/analytics\/automatically-reduce-google-analytics-payload-length\/\">automatically reduce the payload length<\/a>, or split the impressions into <a href=\"https:\/\/www.savio.no\/analytics\/easier-enhanced-ecommerce-product-promo-tracking\">multiple hits<\/a>.<\/p>\n<p>The best thing you can do, but also the most complicated thing to implement, is to create a <a href=\"https:\/\/www.simoahava.com\/analytics\/true-view-impressions-google-tag-manager\/\">true view listener<\/a>, where impressions are sent in batches depending on what the user actually sees in the viewport. So when the user scrolls to a new set of product impressions, you send only those impressions in a hit once they\u2019ve all entered the viewport. This requires a lot of coordination with your developers, but it\u2019s well worth the effort.<\/p>\n<h3 id=\"impression-views\">Impression Views<\/h3>\n<p>Impression Views are collected when the user <strong>sees<\/strong> a product impression in some listing, such as Search Results, Recently Viewed Products, or Related Products.<\/p>\n<p>With Impression Views, it\u2019s important to populate the <code>list<\/code> field with a label that describes the listing where the impression view happened.<\/p>\n<h4 id=\"data-layer-composition-7\">Data Layer composition<\/h4>\n<p>Available fields in the <code>ecommerce<\/code> object:<\/p>\n<table>\n<thead>\n<tr>\n<th>Key<\/th>\n<th>Type<\/th>\n<th>Example<\/th>\n<th>Comment<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>impressions[].id<\/code><\/td>\n<td>String<\/td>\n<td><code>product_id<\/code><\/td>\n<td>The SKU of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>impressions[].name<\/code><\/td>\n<td>String<\/td>\n<td><code>'T-Shirt'<\/code><\/td>\n<td>The name of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>impressions[].category<\/code><\/td>\n<td>String<\/td>\n<td><code>'clothes\/shirts\/t-shirts'<\/code><\/td>\n<td>Product category of the item. Can have maximum five levels of hierarchy.<\/td>\n<\/tr>\n<tr>\n<td><code>impressions[].variant<\/code><\/td>\n<td>String<\/td>\n<td><code>'Large'<\/code><\/td>\n<td>What variant of the main product this is.<\/td>\n<\/tr>\n<tr>\n<td><code>impressions[].brand<\/code><\/td>\n<td>String<\/td>\n<td><code>'NIKE'<\/code><\/td>\n<td>The brand name of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>impressions[].list<\/code><\/td>\n<td>String<\/td>\n<td><code>'Related products'<\/code><\/td>\n<td>The list name where the impression was viewed.<\/td>\n<\/tr>\n<tr>\n<td><code>impressiosn[].position<\/code><\/td>\n<td>Integer<\/td>\n<td><code>3<\/code><\/td>\n<td>The position of the item in the list (e.g. was it the first item in the list, the second, the third, etc.).<\/td>\n<\/tr>\n<tr>\n<td><code>impressions[].dimensionN<\/code><\/td>\n<td>String<\/td>\n<td><code>'Blue'<\/code><\/td>\n<td>A Product-scoped Custom Dimension for index number N.<\/td>\n<\/tr>\n<tr>\n<td><code>impressions[].metricN<\/code><\/td>\n<td>Integer<\/td>\n<td><code>3<\/code><\/td>\n<td>A Product-scoped Custom Metric for index number N.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This is what the <code>dataLayer.push()<\/code> would look like for a set of product impressions with all the <strong>relevant<\/strong> keys included:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer = <span style=\"color:#0aa\">window<\/span>.dataLayer || [];\n<span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  event: <span style=\"color:#a50\">'eec.impressionView'<\/span>,\n  ecommerce: {\n    impressions: [{\n      id: <span style=\"color:#a50\">'product_1'<\/span>,\n      name: <span style=\"color:#a50\">'Great article'<\/span>,\n      category: <span style=\"color:#a50\">'guides\/google-tag-manager\/javascript'<\/span>,\n      list: <span style=\"color:#a50\">'Related products'<\/span>,\n      position: <span style=\"color:#099\">1<\/span>,\n      dimension3: <span style=\"color:#a50\">'500 pages'<\/span>\n    },{\n      id: <span style=\"color:#a50\">'product_2'<\/span>,\n      name: <span style=\"color:#a50\">'Greater article'<\/span>,\n      category: <span style=\"color:#a50\">'guides\/google-tag-manager\/java'<\/span>,\n      list: <span style=\"color:#a50\">'Related products'<\/span>,\n      position: <span style=\"color:#099\">2<\/span>,\n      dimension3: <span style=\"color:#a50\">'1500 pages'<\/span>\n    }]\n  }\n});\n<\/code><\/pre>\n<\/div>\n<blockquote>\n<p>Remember, if you want to use a Custom JavaScript variable instead, the variable must return the <code>ecommerce<\/code> object from the <code>dataLayer.push()<\/code> above.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-example-7\">Tag configuration example<\/h4>\n<p>Typical <strong>Event tag<\/strong>:<\/p>\n<div style=\"aspect-ratio: 929 \/ 927;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/impression-view-tag.jpg\" title=\"Impression view tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"927\" width=\"929\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/impression-view-tag.jpg#ZgotmplZ\" alt=\"Impression view tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The <strong>trigger<\/strong> would be a <strong>Custom Event trigger<\/strong> with the following setting:<\/p>\n<p><strong>Event name<\/strong>: <code>eec.impressionView<\/code><\/p>\n<h3 id=\"impression-clicks\">Impression Clicks<\/h3>\n<p>Impression Clicks (or Product Clicks) are technically <strong>Actions<\/strong>, but I decided to group them under Impressions since that\u2019s where they belong.<\/p>\n<p>An Impression Click is sent when an impression that the user has viewed is clicked. It\u2019s an important metric to follow in case you are measuring Impression Views, because once you start collecting Impression Clicks, too, you can measure things like click-through-rates per product list, position, and individual impression.<\/p>\n<h4 id=\"data-layer-composition-8\">Data Layer composition<\/h4>\n<p>Available fields in the <code>ecommerce<\/code> object:<\/p>\n<table>\n<thead>\n<tr>\n<th>Key<\/th>\n<th>Type<\/th>\n<th>Example<\/th>\n<th>Comment<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>actionField.list<\/code><\/td>\n<td>String<\/td>\n<td><code>'Related products'<\/code><\/td>\n<td>The list where the user first viewed the product and then clicked it. Make sure the value of the <code>list<\/code> attribute matches that sent with the Impression View.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].id<\/code><\/td>\n<td>String<\/td>\n<td><code>'P12345'<\/code><\/td>\n<td>The SKU of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].name<\/code><\/td>\n<td>String<\/td>\n<td><code>'T-Shirt'<\/code><\/td>\n<td>The name of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].category<\/code><\/td>\n<td>String<\/td>\n<td><code>'clothes\/shirts\/t-shirts'<\/code><\/td>\n<td>Product category of the item. Can have maximum five levels of hierarchy.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].variant<\/code><\/td>\n<td>String<\/td>\n<td><code>'Large'<\/code><\/td>\n<td>What variant of the main product this is.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].brand<\/code><\/td>\n<td>String<\/td>\n<td><code>'NIKE'<\/code><\/td>\n<td>The brand name of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].position<\/code><\/td>\n<td>Integer<\/td>\n<td><code>1<\/code><\/td>\n<td>The position of the impression that was clicked.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].dimensionN<\/code><\/td>\n<td>String<\/td>\n<td><code>'Blue'<\/code><\/td>\n<td>A Product-scoped Custom Dimension for index number N.<\/td>\n<\/tr>\n<tr>\n<td><code>products[].metricN<\/code><\/td>\n<td>Integer<\/td>\n<td><code>3<\/code><\/td>\n<td>A Product-scoped Custom Metric for index number N.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This is what the <code>dataLayer.push()<\/code> for an Impression Click would look like with all the <strong>relevant<\/strong> keys populated:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer = <span style=\"color:#0aa\">window<\/span>.dataLayer || [];\n<span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  event: <span style=\"color:#a50\">'eec.impressionClick'<\/span>,\n  ecommerce: {\n    click: {\n      actionField: {\n        list: <span style=\"color:#a50\">'Related products'<\/span>\n      },\n      products: [{\n        id: <span style=\"color:#a50\">'product_2'<\/span>,\n        name: <span style=\"color:#a50\">'Greater article'<\/span>,\n        category: <span style=\"color:#a50\">'guides\/google-tag-manager\/java'<\/span>,\n        position: <span style=\"color:#099\">2<\/span>,\n        dimension3: <span style=\"color:#a50\">'1500 pages'<\/span>\n      }]\n    }\n  }\n});\n<\/code><\/pre>\n<\/div>\n<blockquote>\n<p>Remember, if you want to use a Custom JavaScript variable instead, the variable must return the <code>ecommerce<\/code> object from the <code>dataLayer.push()<\/code> above.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-example-8\">Tag configuration example<\/h4>\n<p>Typical <strong>Event tag<\/strong>:<\/p>\n<div style=\"aspect-ratio: 981 \/ 940;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/impression-click-tag.jpg\" title=\"Impression Click tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"940\" width=\"981\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/impression-click-tag.jpg#ZgotmplZ\" alt=\"Impression Click tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The <strong>trigger<\/strong> would be a <strong>Custom Event trigger<\/strong> with the following setting:<\/p>\n<p><strong>Event name<\/strong>: <code>eec.impressionClick<\/code><\/p>\n<p>Promotions are similar to impressions in that they, too, comprise a View and a Click. However, unlike any of the other Enhanced Ecommerce data types, promotions do not involve products. Rather, you are measuring the <strong>promotions<\/strong> themselves. These would typically be banners, product category highlights or something similar.<\/p>\n<p>With promotion tracking, you can measure the success of your site marketing efforts, by seeing if viewing and clicking individual banners and advertisements lead to ecommerce success.<\/p>\n<h3 id=\"promotion-views\">Promotion Views<\/h3>\n<p>Promotion Views are sent when the user sees a promotion on the site. As with impressions, you can send more than one Promotion View in a hit, but as with impressions, you need to be careful not to group too many views into one hit, as you might be in danger of breaching the 8KB size limit for the Google Analytics payload.<\/p>\n<h4 id=\"data-layer-composition-9\">Data Layer composition<\/h4>\n<p>Available fields in the <code>ecommerce<\/code> object:<\/p>\n<table>\n<thead>\n<tr>\n<th>Key<\/th>\n<th>Type<\/th>\n<th>Example<\/th>\n<th>Comment<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>promotions[].id<\/code><\/td>\n<td>String<\/td>\n<td><code>'summer_campaign'<\/code><\/td>\n<td>Unique identifier for the promotion.<\/td>\n<\/tr>\n<tr>\n<td><code>promotions[].name<\/code><\/td>\n<td>String<\/td>\n<td><code>'Summer Campaign 2019'<\/code><\/td>\n<td>The name of the promotion.<\/td>\n<\/tr>\n<tr>\n<td><code>promotions[].creative<\/code><\/td>\n<td>String<\/td>\n<td><code>'front_page_banner_1'<\/code><\/td>\n<td>A name for the creative where the promotion is showing.<\/td>\n<\/tr>\n<tr>\n<td><code>promotions[].position<\/code><\/td>\n<td>String<\/td>\n<td><code>'slot_2'<\/code><\/td>\n<td>Some way to distinguish the position of the promotion in the creative (e.g. second slide of a carousel).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This is what the <code>dataLayer.push()<\/code> would look like for a set of Promotion Views with all the <strong>relevant<\/strong> keys included:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer = <span style=\"color:#0aa\">window<\/span>.dataLayer || [];\n<span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  event: <span style=\"color:#a50\">'eec.promotionView'<\/span>,\n  ecommerce: {\n    promoView: {\n      promotions: [{\n        id: <span style=\"color:#a50\">'summer_campaign'<\/span>,\n        name: <span style=\"color:#a50\">'Summer Campaign 2019'<\/span>,\n        creative: <span style=\"color:#a50\">'Front Page Carousel'<\/span>,\n        position: <span style=\"color:#a50\">'Slide 1'<\/span>\n      },{\n        id: <span style=\"color:#a50\">'fall_campaign'<\/span>,\n        name: <span style=\"color:#a50\">'Fall Campaign 2019'<\/span>,\n        creative: <span style=\"color:#a50\">'Front Page Carousel'<\/span>,\n        position: <span style=\"color:#a50\">'Slide 2'<\/span>\n      }]\n    }\n  }\n});\n<\/code><\/pre>\n<\/div>\n<blockquote>\n<p>Remember, if you want to use a Custom JavaScript variable instead, the variable must return the <code>ecommerce<\/code> object from the <code>dataLayer.push()<\/code> above.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-example-9\">Tag configuration example<\/h4>\n<p>Typical <strong>Event tag<\/strong>:<\/p>\n<div style=\"aspect-ratio: 903 \/ 932;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/promotion-view-tag.jpg\" title=\"Promotion view tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"932\" width=\"903\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/promotion-view-tag.jpg#ZgotmplZ\" alt=\"Promotion view tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The <strong>trigger<\/strong> would be a <strong>Custom Event trigger<\/strong> with the following setting:<\/p>\n<p><strong>Event name<\/strong>: <code>eec.promotionView<\/code><\/p>\n<h3 id=\"promotion-clicks\">Promotion Clicks<\/h3>\n<p>A Promotion Click is collected when an individual promotion is clicked. It\u2019s important to measure these if you are also measuring Promotion Views, because this way you\u2019ll get a solid understanding of the click-through rate of individual promotions and how these promotions are involved in generating revenue in your webstore.<\/p>\n<p>Available fields in the <code>ecommerce<\/code> object:<\/p>\n<table>\n<thead>\n<tr>\n<th>Key<\/th>\n<th>Type<\/th>\n<th>Example<\/th>\n<th>Comment<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>promotions[].id<\/code><\/td>\n<td>String<\/td>\n<td><code>'summer_campaign'<\/code><\/td>\n<td>Unique identifier for the promotion.<\/td>\n<\/tr>\n<tr>\n<td><code>promotions[].name<\/code><\/td>\n<td>String<\/td>\n<td><code>'Summer Campaign 2019'<\/code><\/td>\n<td>The name of the promotion.<\/td>\n<\/tr>\n<tr>\n<td><code>promotions[].creative<\/code><\/td>\n<td>String<\/td>\n<td><code>'front_page_banner_1'<\/code><\/td>\n<td>A name for the creative where the promotion was clicked.<\/td>\n<\/tr>\n<tr>\n<td><code>promotions[].position<\/code><\/td>\n<td>String<\/td>\n<td><code>'slot_2'<\/code><\/td>\n<td>Some way to distinguish the position of the promotion in the creative (e.g. second slide of a carousel).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This is what the <code>dataLayer.push()<\/code> would look like for a Promotion Views with all the <strong>relevant<\/strong> keys included:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer = <span style=\"color:#0aa\">window<\/span>.dataLayer || [];\n<span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  event: <span style=\"color:#a50\">'eec.promotionClick'<\/span>,\n  ecommerce: {\n    promoClick: {\n      promotions: [{\n        id: <span style=\"color:#a50\">'fall_campaign'<\/span>,\n        name: <span style=\"color:#a50\">'Fall Campaign 2019'<\/span>,\n        creative: <span style=\"color:#a50\">'Front Page Carousel'<\/span>,\n        position: <span style=\"color:#a50\">'Slide 2'<\/span>\n      }]\n    }\n  }\n});\n<\/code><\/pre>\n<\/div>\n<blockquote>\n<p>Remember, if you want to use a Custom JavaScript variable instead, the variable must return the <code>ecommerce<\/code> object from the <code>dataLayer.push()<\/code> above.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-example-10\">Tag configuration example<\/h4>\n<p>Typical <strong>Event tag<\/strong>:<\/p>\n<div style=\"aspect-ratio: 960 \/ 931;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/promotion-click-tag.jpg\" title=\"Promotion click tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"931\" width=\"960\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/promotion-click-tag.jpg#ZgotmplZ\" alt=\"Promotion click tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The <strong>trigger<\/strong> would be a <strong>Custom Event trigger<\/strong> with the following setting:<\/p>\n<p><strong>Event name<\/strong>: <code>eec.promotionClick<\/code><\/p>\n<h2 id=\"debugging-the-setup\">Debugging the setup<\/h2>\n<p>Once you have everything in place, you\u2019ll want to debug your setup. The things you are looking for are:<\/p>\n<ul>\n<li>\n<p>Are all the keys configured in the <code>dataLayer.push()<\/code> (or the Custom JavaScript variable) getting picked up and being sent to Google Analytics?<\/p>\n<\/li>\n<li>\n<p>Is the payload length too long?<\/p>\n<\/li>\n<li>\n<p>Is there a risk of data duplication with some hits?<\/p>\n<\/li>\n<\/ul>\n<p>To debug these, you really only need three tools: GTM\u2019s own Preview mode, the Google Analytics Debugger browser extension, and Google Chrome browser\u2019s DevTools. Yes, there are plenty of other tools you can use, but these have proven to be more than enough in my own experience.<\/p>\n<h3 id=\"preview-mode\">Preview mode<\/h3>\n<p>With Preview mode, you can analyze what fields were sent with your Enhanced Ecommerce -enabled Google Analytics tag. You can also compare these fields with what was originally pushed into <code>dataLayer<\/code>, or what the Custom JavaScript variable returned.<\/p>\n<p>Once you have your <code>ecommerce<\/code> object either pushed into <code>dataLayer<\/code> or generated by a Custom JavaScript variable, the next step is to go to Preview mode, then browsing the site and generating the action that sends the ecommerce data to GA.<\/p>\n<p>Here\u2019s what you\u2019re looking for in the Preview mode:<\/p>\n<div style=\"aspect-ratio: 684 \/ 260;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/preview-mode.jpg\" title=\"Preview mode\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"260\" width=\"684\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/preview-mode.jpg#ZgotmplZ\" alt=\"Preview mode\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>In the left-hand side, you\u2019re looking for the <strong>Event name<\/strong> that you pushed into <code>dataLayer<\/code> with the <code>'event'<\/code> key. Remember, you should add one in to every single push?<\/p>\n<p>Click that event, and you should see your Enhanced Ecommerce tag in the list tags that fired. If you don\u2019t, it means there\u2019s something wrong with its trigger. So find the tag in the list of tags that did <strong>not<\/strong> fire, select it, and scroll down to its triggers. You\u2019ll see a red X next to each trigger condition that failed, so double-check them and make sure the conditions pass when they should.<\/p>\n<div style=\"aspect-ratio: 675 \/ 267;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/tag-did-not-fire.jpg\" title=\"Tag did not fire\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"267\" width=\"675\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/tag-did-not-fire.jpg#ZgotmplZ\" alt=\"Tag did not fire\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Anyway, if the tag DID fire and if it sent an event (or page view) hit to Google Analytics successfully, you\u2019ll see <strong>Succeeded<\/strong> as its Firing Status. Double-check that the Enhanced Ecommerce settings are correct, too.<\/p>\n<div style=\"aspect-ratio: 848 \/ 490;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/successful-tag-preview-mode.jpg\" title=\"Successful tag in preview mode\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"490\" width=\"848\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/successful-tag-preview-mode.jpg#ZgotmplZ\" alt=\"Successful tag in preview mode\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"google-analytics-debugger-and-chrome-devtools\">Google Analytics Debugger and Chrome DevTools<\/h3>\n<p>Now you know that your tag fired and that it sent the event\/pageview to GA successfully. But what about the Enhanced Ecommerce payload? Were all the keys and values you configured included?<\/p>\n<p>For this, you have plenty of options. You can use a tool like <a href=\"https:\/\/chrome.google.com\/webstore\/detail\/tag-assistant-by-google\/kejbdjndbnbjgmefkgdddjlbokphdefk?hl=en\">Google Tag Assistant<\/a> which will tell you what parameters were included in the hit. Or you can use <a href=\"https:\/\/www.thyngster.com\/\">David Vallejo\u2019s<\/a> excellent <a href=\"https:\/\/chrome.google.com\/webstore\/detail\/gtm-debug\/ilnpmccnfdjdjjikgkefkcegefikecdc?hl=en\">GTM Debug<\/a> Chrome extension, which has a great visualization of the Enhanced Ecommerce data.<\/p>\n<p>The key is to see what data was included in the hit and to compare that against what was pushed into <code>dataLayer<\/code> or what the Custom JavaScript variable returned.<\/p>\n<p>Personally, I simply use the <a href=\"https:\/\/chrome.google.com\/webstore\/detail\/google-analytics-debugger\/jnkmfdileelhofjcijamephohjechhna?hl=en\"><strong>Google Analytics Debugger<\/strong><\/a> extension. It uses the <a href=\"https:\/\/developers.google.com\/web\/tools\/chrome-devtools\/console\/\">JavaScript Console<\/a> of the web browser to output a log of all the interactions with Google Analytics trackers on the page.<\/p>\n<p>For example, in my Purchase example above, this is what the GA debugger will tell me:<\/p>\n<div style=\"aspect-ratio: 1514 \/ 533;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/ga-debugger-output.jpg\" title=\"GA Debugger output\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"533\" width=\"1514\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/ga-debugger-output.jpg#ZgotmplZ\" alt=\"GA Debugger output\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Here, you can see that the hit is missing the <strong>tax<\/strong> that I pushed into <code>dataLayer<\/code>. The key I used was <code>orderTax<\/code>, as you can see in the screenshot.<\/p>\n<p>So now I open this guide again, scroll all the way to the Purchase hit, look at the Data Layer Composition example, and see my mistake. It shouldn\u2019t be <code>orderTax<\/code>, it should be just <code>tax<\/code>.<\/p>\n<p>I fix the <code>dataLayer.push()<\/code>, re-run the test and now I can see that everything works.<\/p>\n<div style=\"aspect-ratio: 1506 \/ 515;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/ga-debugger-works.jpg\" title=\"GA Debugger output\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"515\" width=\"1506\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/ga-debugger-works.jpg#ZgotmplZ\" alt=\"GA Debugger output\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Here\u2019s the <strong>most important thing about debugging Enhanced Ecommerce hits<\/strong>:<\/p>\n<blockquote>\n<p><strong>Never<\/strong> be satisfied with using Preview mode alone. Preview mode will only tell you if a tag fired, NOT if it sent the correct data to Google Analytics. You <strong>must<\/strong> debug the actual payload sent to Google Analytics, too. For this, Chrome\u2019s DevTools are a great tool, but there are plenty of extensions out there that outline the data in a clear and concise manner.<\/p>\n<\/blockquote>\n<h2 id=\"golden-rules-of-enhanced-ecommerce\">Golden rules of Enhanced Ecommerce<\/h2>\n<p>Now follow some Enhanced Ecommerce tips that I consider absolutely vital for any implementation. I\u2019ve accumulated them over years of practice, and I don\u2019t hesitate to call them \u201crules\u201d even if I\u2019m typically very cautious to give any kind of recommendations to anyone.<\/p>\n<p>So read through them, and if you have more suggestions for golden rules, let me know in the comments!<\/p>\n<h3 id=\"do-whatever-you-want\">Do whatever you want<\/h3>\n<p>This is important. You can use Enhanced Ecommerce <strong>however you want<\/strong>. There\u2019s no law that forces you to use the data types in the way that Google recommends you to.<\/p>\n<p>For example, not all websites have a shopping cart. You directly buy products from product pages. In those cases, don\u2019t send the Add to Cart event. Or, alternatively, send a dummy Add to Cart whenever the user moves to the checkout funnel.<\/p>\n<p>It\u2019s entirely up to you.<\/p>\n<p>Heck, you can even use Enhanced Ecommerce for something completely unrelated to ecommerce. For example, you can use it to <a href=\"https:\/\/www.simoahava.com\/analytics\/track-content-enhanced-ecommerce\/\">track content engagement on your site<\/a>.<\/p>\n<h3 id=\"the-purchase-action-is-most-important\">The Purchase action is most important<\/h3>\n<p>The <strong>Purchase<\/strong> action is absolutely the most important part of Enhanced Ecommerce. You can ignore or mess up all the other steps in the funnel, but you will <strong>never<\/strong> want to screw up the purchase hit. So many metrics and dimensions rely on the transaction data to be accurate.<\/p>\n<p>When you\u2019re calculating the investment for implementing Enhanced Ecommerce, add some extra buffer to getting the purchase right. It\u2019s that important.<\/p>\n<h3 id=\"only-one-action-per-hit\">Only one action per hit<\/h3>\n<p>Remember to only send <strong>one action<\/strong> per hit. There are <a href=\"#combining-different-data-types-in-a-single-eec-hit\">other limitations<\/a>, too, but this is the most common mistake.<\/p>\n<p>You might be tempted to send multiple Checkout steps, for example, but this would violate this rule.<\/p>\n<p>You can only include a single action in a <code>dataLayer.push<\/code> (or in the returned object from a Custom JavaScript variable), so make sure to debug this thoroughly.<\/p>\n<h3 id=\"include-all-the-necessary-details-in-every-hit\">Include all the necessary details in every hit<\/h3>\n<p><strong>Consistency is key<\/strong>. If you send product details such as product variant, brand and category in a Product Detail View, you\u2019ll want to send these with all the subsequent actions (Add to Cart, Checkout, Purchase), too. Otherwise when analyzing the funnel using any of these dimensions as the primary dimension of analysis, you\u2019ll only see data for Product Detail Views and not for any of the other steps.<\/p>\n<p>There is no automatic persistence or attribution of product metadata &#8211; you <strong>must<\/strong> send them with every single hit.<\/p>\n<p>Also, the metadata <strong>must<\/strong> be in the same format in every step. You can\u2019t send <code>brand: 'NIKE'<\/code> in one step, <code>brand: 'Nike'<\/code> in another, and <code>brand: 'nike'<\/code> in another, and expect Google Analytics to treat these as the same value. They will generate three different rows with their own funnels when analyzed using Product Brand as the dimension.<\/p>\n<h3 id=\"there-is-some-attribution\">There is some attribution<\/h3>\n<p>Note that there is <em>some<\/em> attribution in Enhanced Ecommerce; in Product Lists and Promotions, specifically.<\/p>\n<p>When a product is purchased, this purchase will be attributed to the <strong>last promotion<\/strong> the user clicked (or viewed if there was no click) in the session.<\/p>\n<p>Similarly, when any Ecommerce action is taken, this action is also attributed to the <strong>last Product List<\/strong> that was included in an earlier action, <strong>as long as the Product ID in these two actions match<\/strong>.<\/p>\n<p>In other words, if you send a Product Detail View for product with ID <code>my_shirt<\/code>, using <code>product_page<\/code> as the Product List attribute value, then any subsequent action that also involves <code>my_shirt<\/code> will be attributed to the <code>product_page<\/code> list. Useful, right?<\/p>\n<p>Just remember that <strong>attribution is session-scoped<\/strong>. If the session timeout is reached, or if the session cuts off for some other reason, any Product List and Promotion attribution information is lost. That\u2019s why you might see <code>(not set)<\/code> in the corresponding reports.<\/p>\n<h3 id=\"be-wary-of-the-payload-size-limit\">Be wary of the payload size limit<\/h3>\n<p>Remember that the maximum payload length of a Google Analytics request is <strong>8192 bytes<\/strong>. If you\u2019re collecting Product Impressions, or if the typical cart size in your store is 30+ products, you\u2019ll want to see if you\u2019re approaching this limit.<\/p>\n<p>The Google Analytics Debugger will output an error into the console in case you are trying to send hits that are longer than this limit.<\/p>\n<p>See <a href=\"https:\/\/www.simoahava.com\/analytics\/send-google-analytics-payload-length-as-custom-dimension\/\">this article<\/a> for information how to track payload length, and <a href=\"https:\/\/www.simoahava.com\/analytics\/automatically-reduce-google-analytics-payload-length\/\">this<\/a> for a little tool that automatically reduces the payload length.<\/p>\n<h2 id=\"further-reading\">Further reading<\/h2>\n<p>I\u2019ve written a <strong>lot<\/strong> about Enhanced Ecommerce. The easiest way to find this content is to simply <a href=\"https:\/\/www.simoahava.com\/search\/?q=enhanced+ecommerce\">do a search on my site<\/a>.<\/p>\n<p>As for other content, here is a random selection of goodies found on the web:<\/p>\n<h2 id=\"summary\">Summary<\/h2>\n<p>I hope this guide is useful! It is written as an implementation manual rather than a guide for Enhanced Ecommerce in general.<\/p>\n<p>Google\u2019s own documentation is excellent, but there are places where it\u2019s a bit misleading. With this guide, I wanted to get all the relevant information into one place.<\/p>\n<p>Note that I don\u2019t mention <a href=\"https:\/\/developers.google.com\/tag-manager\/ios\/v5\/\">Google Tag Manager For Firebase<\/a> at all. There\u2019s a reason for that: it\u2019s still underdeveloped. There is basic support for Enhanced Ecommerce, but nothing for Product-scoped Custom Dimensions or Metrics, for example. Hopefully these will be introduced soon into the SDKs.<\/p>\n<p>As always, any comments are much appreciated! Please let me know if the guide was useful and if I glossed over or neglected to add some important information. Thank you!<\/p>\n<\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Enhanced Ecommerce is certainly one of the finest reporting user interface features that Google Analytics has to offer. Enhanced Ecommerce, as the name implies, is a set of dimensions, metrics, and reports, which combine to provide you with a fairly complete view into how users are interacting with your products in your webstore. The main [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":103796,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[11161,14269,1531,2059,14495,1791],"dealstore":[],"offerexpiration":[],"class_list":["post-103795","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-ecommerce","tag-enhanced","tag-google","tag-guide","tag-manager","tag-tag"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Enhanced Ecommerce Guide For Google Tag Manager - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=103795\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Enhanced Ecommerce Guide For Google Tag Manager - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"Enhanced Ecommerce is certainly one of the finest reporting user interface features that Google Analytics has to offer. Enhanced Ecommerce, as the name implies, is a set of dimensions, metrics, and reports, which combine to provide you with a fairly complete view into how users are interacting with your products in your webstore. The main [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=103795\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-22T17:56:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/enhanced-ecommerce-guide-for-google-tag-manager.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1006\" \/>\n\t<meta property=\"og:image:height\" content=\"443\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"47 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=103795#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=103795\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"Enhanced Ecommerce Guide For Google Tag Manager\",\"datePublished\":\"2025-02-22T17:56:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=103795\"},\"wordCount\":8287,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=103795#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/enhanced-ecommerce-guide-for-google-tag-manager.jpg\",\"keywords\":[\"ECommerce\",\"enhanced\",\"Google\",\"Guide\",\"Manager\",\"TAG\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=103795#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=103795\",\"url\":\"https:\/\/fivemor.com\/?p=103795\",\"name\":\"Enhanced Ecommerce Guide For Google Tag Manager - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=103795#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=103795#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/enhanced-ecommerce-guide-for-google-tag-manager.jpg\",\"datePublished\":\"2025-02-22T17:56:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=103795#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=103795\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=103795#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/enhanced-ecommerce-guide-for-google-tag-manager.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/enhanced-ecommerce-guide-for-google-tag-manager.jpg\",\"width\":1006,\"height\":443},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=103795#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Enhanced Ecommerce Guide For Google Tag Manager\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Enhanced Ecommerce Guide For Google Tag Manager - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=103795","og_locale":"en_US","og_type":"article","og_title":"Enhanced Ecommerce Guide For Google Tag Manager - Som2ny Network","og_description":"Enhanced Ecommerce is certainly one of the finest reporting user interface features that Google Analytics has to offer. Enhanced Ecommerce, as the name implies, is a set of dimensions, metrics, and reports, which combine to provide you with a fairly complete view into how users are interacting with your products in your webstore. The main [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=103795","og_site_name":"Som2ny Network","article_published_time":"2025-02-22T17:56:39+00:00","og_image":[{"width":1006,"height":443,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/enhanced-ecommerce-guide-for-google-tag-manager.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"47 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=103795#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=103795"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"Enhanced Ecommerce Guide For Google Tag Manager","datePublished":"2025-02-22T17:56:39+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=103795"},"wordCount":8287,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=103795#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/enhanced-ecommerce-guide-for-google-tag-manager.jpg","keywords":["ECommerce","enhanced","Google","Guide","Manager","TAG"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=103795#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=103795","url":"https:\/\/fivemor.com\/?p=103795","name":"Enhanced Ecommerce Guide For Google Tag Manager - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=103795#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=103795#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/enhanced-ecommerce-guide-for-google-tag-manager.jpg","datePublished":"2025-02-22T17:56:39+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=103795#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=103795"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=103795#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/enhanced-ecommerce-guide-for-google-tag-manager.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/enhanced-ecommerce-guide-for-google-tag-manager.jpg","width":1006,"height":443},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=103795#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"Enhanced Ecommerce Guide For Google Tag Manager"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/103795","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=103795"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/103795\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/103796"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=103795"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=103795"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=103795"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=103795"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=103795"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}