{"id":79060,"date":"2025-02-10T03:22:49","date_gmt":"2025-02-10T03:22:49","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/google-analytics-4-ecommerce-guide-for-google-tag-manager\/"},"modified":"2025-02-10T03:22:49","modified_gmt":"2025-02-10T03:22:49","slug":"google-analytics-4-ecommerce-guide-for-google-tag-manager","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=79060","title":{"rendered":"Google Analytics 4: Ecommerce Guide For Google Tag Manager"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<blockquote>\n<p><strong>Last updated 17 March 2023<\/strong>: <a href=\"https:\/\/support.google.com\/analytics\/answer\/9164320?hl=en#031623\">Item-scoped Custom Dimensions<\/a> are now available in Google Analytics 4.<\/p>\n<\/blockquote>\n<p>This is an <strong>implementation guide<\/strong> for <a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/app-web\/tag-guide\">Google Analytics 4<\/a>. The guide is aimed at <a href=\"https:\/\/tagmanager.google.com\/\">Google Tag Manager<\/a> users and has been designed to complement the <a href=\"https:\/\/developers.google.com\/tag-manager\/ecommerce-appweb\">official documentation<\/a>.<\/p>\n<div style=\"aspect-ratio: 1796 \/ 922;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/app-web-ecommerce.jpg\" title=\"Google Analytics 4 ecommerce\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"922\" width=\"1796\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/app-web-ecommerce.jpg#ZgotmplZ\" alt=\"Google Analytics 4 ecommerce\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>A thing to keep in mind is that Google Analytics 4 (GA4) is <strong>still very new<\/strong>. The Google Tag Manager integration is still in its infancy, and implementation places a lot of responsibility on accurate tagging and proper <code>dataLayer<\/code> instrumentation.<\/p>\n<p>In this guide, I\u2019ll explain the new data model from an implementation perspective, and walk you through the nuts and bolts on how to get the different parts of GA4\u2019s Ecommerce machine to work in unison.<\/p>\n<p>Make sure you follow the official documentation as well:<\/p>\n<div style=\"aspect-ratio: 2332 \/ 368;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/ecom-report.jpg\" title=\"Ecommerce report - App + Web\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"368\" width=\"2332\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/ecom-report.jpg#ZgotmplZ\" alt=\"Ecommerce report - App + Web\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>For help with analysis and what to do once the data hits the reports, make sure to follow <a href=\"https:\/\/www.kristaseiden.com\/\">Krista Seiden\u2019s blog<\/a>, where she\u2019s already added a <a href=\"https:\/\/www.kristaseiden.com\/new-ecommerce-setup-and-reporting-in-google-analytics-appweb\/\">walkthrough of the Ecommerce reports in Google Analytics 4<\/a>.<\/p>\n<p>Other great resources include <a href=\"https:\/\/www.charlesfarina.com\/\">Charles Farina\u2019s blog<\/a> and <a href=\"https:\/\/ken-williams.com\/\">Ken William\u2019s Google Analytics 4 resource<\/a>.<\/p>\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=\"universal-analytics-vs-google-analytics-4\">Universal Analytics vs. Google Analytics 4<\/h2>\n<p>It\u2019s only fair to start with a comparison between Universal Analytics\u2019 <a href=\"https:\/\/www.simoahava.com\/analytics\/enhanced-ecommerce-guide-for-google-tag-manager\/\">Enhanced Ecommerce<\/a> data model and the one put forth by GA4. They\u2019re similar in many places, but also have some key differences that will be covered here.<\/p>\n<h3 id=\"available-actions\">Available actions<\/h3>\n<p>Let\u2019s begin with the types of <strong>events<\/strong> you can collect. They represent the discrete <strong>funnel steps<\/strong> that the data model uses to reflect the funnels in your website.<\/p>\n<p>The <strong>GA4 action<\/strong> in the table below represents the <strong>Event name<\/strong> you need to configure in your site\u2019s code or Google Tag Manager tags when building the respective Ecommerce hit to GA4.<\/p>\n<p>The <strong>Corresponding Enhanced Ecommerce action<\/strong> column refers to what the analogy in Enhanced Ecommerce would be. It\u2019s not just an analogy, though, as there\u2019s a <a href=\"#migrating-from-enhanced-ecommerce\">migration path<\/a> available when upgrading from Google Analytics Enhanced Ecommerce to GA4 Ecommerce.<\/p>\n<table>\n<thead>\n<tr>\n<th>GA4 action<\/th>\n<th>Corresponding Enhanced Ecommerce action<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>view_promotion<\/code><\/td>\n<td><code>promoView<\/code><\/td>\n<td>View of promotions.<\/td>\n<\/tr>\n<tr>\n<td><code>select_promotion<\/code><\/td>\n<td><code>promoClick<\/code><\/td>\n<td>Click on a promotion.<\/td>\n<\/tr>\n<tr>\n<td><code>view_item_list<\/code><\/td>\n<td><code>impressions<\/code><\/td>\n<td>View of item impressions in a list.<\/td>\n<\/tr>\n<tr>\n<td><code>select_item<\/code><\/td>\n<td><code>click<\/code><\/td>\n<td>Click on an item in a list.<\/td>\n<\/tr>\n<tr>\n<td><code>view_item<\/code><\/td>\n<td><code>detail<\/code><\/td>\n<td>View item details.<\/td>\n<\/tr>\n<tr>\n<td><code>add_to_cart<\/code><\/td>\n<td><code>add<\/code><\/td>\n<td>Add item(s) to cart.<\/td>\n<\/tr>\n<tr>\n<td><code>add_to_wishlist<\/code><\/td>\n<td>N\/A<\/td>\n<td>Add item(s) to a wishlist.<\/td>\n<\/tr>\n<tr>\n<td><code>remove_from_cart<\/code><\/td>\n<td><code>remove<\/code><\/td>\n<td>Remove item(s) from the cart.<\/td>\n<\/tr>\n<tr>\n<td><code>view_cart<\/code><\/td>\n<td>N\/A<\/td>\n<td>View the contents of the shopping cart.<\/td>\n<\/tr>\n<tr>\n<td><code>begin_checkout<\/code><\/td>\n<td><code>checkout<\/code>*<\/td>\n<td>Initiate the checkout process.<\/td>\n<\/tr>\n<tr>\n<td><code>add_shipping_info<\/code><\/td>\n<td><code>checkout_option<\/code>*<\/td>\n<td>Add shipping info during the checkout flow.<\/td>\n<\/tr>\n<tr>\n<td><code>add_payment_info<\/code><\/td>\n<td><code>checkout_option<\/code>*<\/td>\n<td>Add payment info during the checkout flow.<\/td>\n<\/tr>\n<tr>\n<td><code>purchase<\/code><\/td>\n<td><code>purchase<\/code><\/td>\n<td>Purchase items that were checked out.<\/td>\n<\/tr>\n<tr>\n<td><code>refund<\/code><\/td>\n<td><code>refund<\/code><\/td>\n<td>Refund one or more items.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><code>*<\/code> The <strong>checkout funnel<\/strong> is collected a bit differently with Google Analytics 4. There are no <em>steps<\/em> anymore &#8211; rather, GA4 offers you the (presumably) most popular checkout steps of adding shipping and payment info to the purchase.<\/p>\n<p>The data model includes some welcome additions that were missing from Universal Analytics, namely <code>add_to_wishlist<\/code> and <code>view_cart<\/code>.<\/p>\n<h3 id=\"product-data\">Product data<\/h3>\n<p>The data model for <strong>products<\/strong> has changed somewhat as well. The concept of a <strong>product list<\/strong> has been widened to include a list identifier, and multi-level <strong>product categories<\/strong> have been expanded to their individual parameters.<\/p>\n<table>\n<thead>\n<tr>\n<th>GA4 parameter<\/th>\n<th>Corresponding Enhanced Ecommerce parameter<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>item_id<\/code><\/td>\n<td><code>id<\/code><\/td>\n<td>ID \/ SKU of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>item_name<\/code><\/td>\n<td><code>name<\/code><\/td>\n<td>Name of the product.<\/td>\n<\/tr>\n<tr>\n<td><code>item_list_name<\/code><\/td>\n<td><code>list<\/code><\/td>\n<td>Product list name.<\/td>\n<\/tr>\n<tr>\n<td><code>item_list_id<\/code><\/td>\n<td>N\/A<\/td>\n<td>Product list identifier.<\/td>\n<\/tr>\n<tr>\n<td><code>index<\/code><\/td>\n<td><code>position<\/code><\/td>\n<td>Product position in the list.<\/td>\n<\/tr>\n<tr>\n<td><code>item_brand<\/code><\/td>\n<td><code>brand<\/code><\/td>\n<td>Product brand.<\/td>\n<\/tr>\n<tr>\n<td><code>item_category<\/code><\/td>\n<td><code>category<\/code><\/td>\n<td>Product category top-level.<\/td>\n<\/tr>\n<tr>\n<td><code>item_category2<\/code><\/td>\n<td><code>category<\/code><\/td>\n<td>Product category 2nd level (or alternative).<\/td>\n<\/tr>\n<tr>\n<td><code>item_category3<\/code><\/td>\n<td><code>category<\/code><\/td>\n<td>Product category 3rd level (or alternative).<\/td>\n<\/tr>\n<tr>\n<td><code>item_category4<\/code><\/td>\n<td><code>category<\/code><\/td>\n<td>Product category 4th level (or alternative).<\/td>\n<\/tr>\n<tr>\n<td><code>item_category5<\/code><\/td>\n<td><code>category<\/code><\/td>\n<td>Product category 5th level (or alternative).<\/td>\n<\/tr>\n<tr>\n<td><code>item_variant<\/code><\/td>\n<td><code>variant<\/code><\/td>\n<td>Item variant name or description.<\/td>\n<\/tr>\n<tr>\n<td><code>affiliation<\/code><\/td>\n<td>N\/A<\/td>\n<td>The store affiliation for this event.<\/td>\n<\/tr>\n<tr>\n<td><code>discount<\/code><\/td>\n<td>N\/A<\/td>\n<td>Any discount associated with this product.<\/td>\n<\/tr>\n<tr>\n<td><code>coupon<\/code><\/td>\n<td><code>coupon<\/code><\/td>\n<td>Coupon associated with this product.<\/td>\n<\/tr>\n<tr>\n<td><code>price<\/code><\/td>\n<td><code>price<\/code><\/td>\n<td>Price of this product.<\/td>\n<\/tr>\n<tr>\n<td><code>currency<\/code><\/td>\n<td>N\/A<\/td>\n<td>Currency of the price that is collected.<\/td>\n<\/tr>\n<tr>\n<td><code>quantity<\/code><\/td>\n<td><code>quantity<\/code><\/td>\n<td>Quantity of the item. <strong>Must be an integer<\/strong>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>As with Enhanced Ecommerce, <strong>either<\/strong> the <code>item_id<\/code> <strong>or<\/strong> <code>item_name<\/code> is always required when products are dealt with. The other parameters might have varying levels of importance, but those two are the only ones that are required.<\/p>\n<p>Some parameters such as <code>affiliation<\/code> and <code>currency<\/code> are brought from the <strong>action-level<\/strong> in Enhanced Ecommerce to <strong>product-level<\/strong> in Google Analytics 4. It\u2019s an interesting choice, as it might not reflect reality to specify these on a product-by-product basis, but it\u2019s never a bad thing to have as many parameters as possible available.<\/p>\n<h3 id=\"promotion-data\">Promotion data<\/h3>\n<p>With GA4, it\u2019s still possible to collect information about <strong>promotions<\/strong>. As with Enhanced Ecommerce, they\u2019re a bit of an odd duck when it comes to the data model, as they describe <strong>banners<\/strong> and <strong>other promotions<\/strong> that might not be actually related to any specific products.<\/p>\n<table>\n<thead>\n<tr>\n<th>GA4 parameter<\/th>\n<th>Corresponding Enhanced Ecommerce parameter<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>promotion_id<\/code><\/td>\n<td><code>id<\/code><\/td>\n<td>ID of the promotion.<\/td>\n<\/tr>\n<tr>\n<td><code>promotion_name<\/code><\/td>\n<td><code>name<\/code><\/td>\n<td>Name of the promotion.<\/td>\n<\/tr>\n<tr>\n<td><code>creative_name<\/code><\/td>\n<td><code>creative<\/code><\/td>\n<td>Name of the creative associated with the promotion.<\/td>\n<\/tr>\n<tr>\n<td><code>creative_slot<\/code><\/td>\n<td><code>position<\/code><\/td>\n<td>Name of the slot where the creative was shown.<\/td>\n<\/tr>\n<tr>\n<td><code>location_id<\/code><\/td>\n<td>N\/A<\/td>\n<td>The physical location associated with the item. It\u2019s recommended to use the <a href=\"https:\/\/developers.google.com\/maps\/documentation\/places\/web-service\/place-id\">Google Place ID<\/a> that corresponds to the location.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>As with Enhanced Ecommerce, <strong>either<\/strong> the <code>promotion_id<\/code> <strong>or<\/strong> <code>promotion_name<\/code> is always required when promotions are sent.<\/p>\n<h3 id=\"action-data\">Action data<\/h3>\n<p>The importance of different action parameters varies greatly by whatever action is being measured. Broadly speaking, <strong>action data<\/strong> refers to parameters the describe the action itself rather than the products within.<\/p>\n<table>\n<thead>\n<tr>\n<th>GA4 parameter<\/th>\n<th>Corresponding Enhanced Ecommerce parameter<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>transaction_id<\/code><\/td>\n<td><code>id<\/code><\/td>\n<td>Unique ID for the transaction. <strong>Required<\/strong> for <code>purchase<\/code> and <code>refund<\/code> events.<\/td>\n<\/tr>\n<tr>\n<td><code>affiliation<\/code><\/td>\n<td><code>affiliation<\/code><\/td>\n<td>The store or affiliation where the purchase occurred.<\/td>\n<\/tr>\n<tr>\n<td><code>value<\/code><\/td>\n<td><code>revenue<\/code><\/td>\n<td>The value associated with the event.<\/td>\n<\/tr>\n<tr>\n<td><code>currency<\/code><\/td>\n<td><code>currencyCode<\/code><\/td>\n<td>Local currency of the collected price. <strong>Required<\/strong> for <code>purchase<\/code> events.<\/td>\n<\/tr>\n<tr>\n<td><code>tax<\/code><\/td>\n<td><code>tax<\/code><\/td>\n<td>How much tax is included in the total revenue of the purchase.<\/td>\n<\/tr>\n<tr>\n<td><code>shipping<\/code><\/td>\n<td><code>shipping<\/code><\/td>\n<td>Shipping costs included in the total revenue of the purchase.<\/td>\n<\/tr>\n<tr>\n<td><code>items<\/code><\/td>\n<td><code>products<\/code>\/<code>impressions<\/code>\/<code>promotions<\/code><\/td>\n<td>Products associated with the event.<\/td>\n<\/tr>\n<tr>\n<td><code>shipping_tier<\/code><\/td>\n<td><code>option<\/code><\/td>\n<td>The shipping tier used with <code>add_shipping_info<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><code>payment_type<\/code><\/td>\n<td><code>option<\/code><\/td>\n<td>The payment method sent with <code>add_payment_info<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><code>coupon<\/code><\/td>\n<td><code>coupon<\/code><\/td>\n<td>Coupon associated with the event.<\/td>\n<\/tr>\n<tr>\n<td><code>promotion_id<\/code><\/td>\n<td>N\/A<\/td>\n<td>ID of a promotion associated with the event.<\/td>\n<\/tr>\n<tr>\n<td><code>promotion_name<\/code><\/td>\n<td>N\/A<\/td>\n<td>Name of a promotion associated with the event.<\/td>\n<\/tr>\n<tr>\n<td><code>creative_name<\/code><\/td>\n<td>N\/A<\/td>\n<td>Name of a promotion creative associated with the event.<\/td>\n<\/tr>\n<tr>\n<td><code>creative_slot<\/code><\/td>\n<td>N\/A<\/td>\n<td>Name of the creative slot associated with the event.<\/td>\n<\/tr>\n<tr>\n<td><code>location_id<\/code><\/td>\n<td>N\/A<\/td>\n<td>The physical location associated with the item. It\u2019s recommended to use the <a href=\"https:\/\/developers.google.com\/maps\/documentation\/places\/web-service\/place-id\">Google Place ID<\/a> that corresponds to the location.<\/td>\n<\/tr>\n<tr>\n<td><code>item_list_name<\/code><\/td>\n<td>N\/A<\/td>\n<td>Name of the list associated with the event.<\/td>\n<\/tr>\n<tr>\n<td><code>item_list_id<\/code><\/td>\n<td>N\/A<\/td>\n<td>ID of the list associated with the event.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"parity-issues\">Parity issues<\/h3>\n<p>It looks like there are certain aspects of Enhanced Ecommerce that have not been transported to GA4 yet.<\/p>\n<p>These are things that I hope (and expect) to see in the product before long, at which point I will naturally update this article accordingly.<\/p>\n<h4 id=\"product-list-attribution\">Product List Attribution<\/h4>\n<p><strong>Product list attribution<\/strong> is a <a href=\"https:\/\/www.simoahava.com\/analytics\/attribution-enhanced-ecommerce-reports\/\">staple of Enhanced Ecommerce<\/a>. It\u2019s extremely useful, as it lets you build the <code>dataLayer<\/code> so that product list information <strong>does not<\/strong> need to be persisted from action to action.<\/p>\n<p>There\u2019s no evidence that a similar attribution setup works with GA4 right now. Granted, attribution is part of a data model that might simply not be exposed in GA4 Ecommerce reports yet, so this is something that is likely to be fixed in the near future. It would be odd to have <em>product lists<\/em> as a data type without them actually having any functionality.<\/p>\n<div style=\"aspect-ratio: 2344 \/ 484;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/product-list-attribution.jpg\" title=\"Product list attribution\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"484\" width=\"2344\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/product-list-attribution.jpg#ZgotmplZ\" alt=\"Product list attribution\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Note that the GA4 data model allows you to send things like <code>item_list_name<\/code> and <code>promotion_id<\/code> in <strong>any<\/strong> Ecommerce object to GA4. You can add them into an <code>items<\/code> array to indicate that specific items are in this current action due to an interaction with a list or promotion earlier in the session. Or you can add them as regular parameters to the event tag itself, in case the current Ecommerce action took place in a specific item list or within some promotion context.<\/p>\n<h4 id=\"checkout-measurement\">Checkout measurement<\/h4>\n<p>As mentioned <a href=\"#available-actions\">above<\/a>, checkout tracking has certainly changed between Enhanced Ecommerce and GA4.<\/p>\n<p>Where Enhanced Ecommerce introduces a combination of <strong>funnel steps<\/strong> (e.g. view cart, shipping, payment) and <strong>checkout options<\/strong> (e.g. shipping method, payment method), GA4 only has the <code>begin_checkout<\/code> event for establishing entrance into the checkout flow.<\/p>\n<p>There are no additional <em>steps<\/em>. Rather, you can use <strong>actions<\/strong> such as <code>view_cart<\/code>, <code>add_shipping_info<\/code>, and <code>add_payment_info<\/code> to flesh out the funnel.<\/p>\n<p>It would be cool to be able to specify a more complete funnel in whatever way I want, and it would also be amazing if we could have multiple different checkout funnels in the data schema.<\/p>\n<p>But on the other hand, I don\u2019t think this is a very big omission currently. I wouldn\u2019t be too surprised if this <em>isn\u2019t<\/em> expanded to have full parity with Enhanced Ecommerce.<\/p>\n<h2 id=\"implementation-with-google-tag-manager\">Implementation with Google Tag Manager<\/h2>\n<blockquote>\n<p><strong>Update 24 August 2022<\/strong>: You can now load the Ecommerce data in your GA4 Event tags directly from the <code>dataLayer<\/code> (if you follow the <a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/ga4\/ecommerce?client_type=gtm\">prescribed GA4 schema<\/a>) or by using a Custom JavaScript variable (or a variable template) that returns an object in the same schema.<\/p>\n<\/blockquote>\n<p>When implementing GA4 Ecommerce using Google Tag Manager, the <em>beta<\/em>-ness of the feature really strikes you hard. The only available event tag type is a generic chassis used for sending any type of event. There\u2019s no built-in Ecommerce integration, as you\u2019ll need to populate the parameters manually.<\/p>\n<div style=\"aspect-ratio: 1774 \/ 542;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/tag-example.jpg\" title=\"Tag example\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"542\" width=\"1774\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/tag-example.jpg#ZgotmplZ\" alt=\"Tag example\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>It would be <em>so<\/em> much simpler to just have a single tag for Ecommerce events, which automatically collects the action parameters and items from the <code>dataLayer<\/code>, depending on which event name is included in the <code>dataLayer<\/code> object.<\/p>\n<p>I\u2019m sure we\u2019ll see something like this before the tags are out of beta, though.<\/p>\n<p>An additional hiccup is the <a href=\"https:\/\/www.simoahava.com\/analytics\/enhanced-ecommerce-guide-for-google-tag-manager\/#send-the-data-to-google-analytics-using-a-custom-javascript-variable\">Custom JavaScript variable<\/a> (or custom template) option, which we\u2019ve been spoiled with when using Enhanced Ecommerce.<\/p>\n<p>Even though you can use a Custom JavaScript variable (or a <a href=\"https:\/\/www.simoahava.com\/analytics\/custom-templates-guide-for-google-tag-manager\/\">custom template<\/a>) to map the <code>items<\/code> array however you wish, you\u2019re still forced to add all the other parameters as individual fields into the tag.<\/p>\n<p>I hope we get an option similar to Enhanced Ecommerce, where the <strong>entire<\/strong> event payload could be fetched from a variable. That way we could have a really dynamic setup and minimize the number of tags we\u2019re using. Not just for Ecommerce but for <strong>all<\/strong> GA4 data collection!<\/p>\n<h3 id=\"item-scoped-custom-dimensions\">Item-scoped Custom Dimensions<\/h3>\n<p>Google Analytics 4 lets you send up to <strong>27<\/strong> custom parameters in the <code>items<\/code> array. Out of these, you can register <strong>10<\/strong> (free version of GA4) or <strong>25<\/strong> (enterprise version) as <strong>Item-scoped Custom Dimensions<\/strong> in the Google Analytics 4 user interface.<\/p>\n<div style=\"aspect-ratio: 1236 \/ 136;\" class=\"figure \">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/custom-item-parameters.jpg\" title=\"Custom item parameters, where k0 is the parameter name prefix, and v0 is the value prefix.\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"136\" width=\"1236\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/custom-item-parameters.jpg#ZgotmplZ\" alt=\"Custom item parameters, where k0 is the parameter name prefix, and v0 is the value prefix.\"\/><\/p>\n<p>    <\/a><\/p>\n<p>    <span class=\"caption\">Custom item parameters, where k0 is the parameter name prefix, and v0 is the value prefix.<\/span><\/p>\n<\/div>\n<p>You can create the Custom Dimension following the regular process in the <strong>Admin<\/strong> section of Google Analytics 4.<\/p>\n<div style=\"aspect-ratio: 1230 \/ 514;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2023\/03\/item-scoped-custom-dim.jpg\" title=\"item-scoped-custom-dim.jpg\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"514\" width=\"1230\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2023\/03\/item-scoped-custom-dim.jpg#ZgotmplZ\" alt=\"item-scoped-custom-dim.jpg\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Currently, item-scoped parameters are <strong>not<\/strong> part of the Google Analytics 4 export to BigQuery.<\/p>\n<h3 id=\"migrating-from-enhanced-ecommerce\">Migrating from Enhanced Ecommerce<\/h3>\n<p>Before you start rewriting your <code>dataLayer<\/code> objects, do note that Google Analytics 4 Ecommerce <strong>does support the Enhanced Ecommerce data model<\/strong> &#8211; at least to some extent.<\/p>\n<p>The main path of migration is that you <strong>do not have to provide an <code>items<\/code> object<\/strong> in GA4 syntax. Instead, you can set the value of the <code>items<\/code> parameter in the tag to an <code>impressions<\/code> or <code>promotions<\/code> or <code>products<\/code> variable in your Enhanced Ecommerce object. GA4 will be able to map the parameter names in the Enhanced Ecommerce <code>products<\/code> object to their corresponding parameters in the Google Analytics 4 schema.<\/p>\n<p>If you read through the comparison chapters above, you\u2019ll remember that there are some distinct differences between these data models. For example, there is no <code>item_list_id<\/code> analogy in Enhanced Ecommerce, and the product category is split into five different levels rather than the slash-separated single parameter in Enhanced Ecommerce.<\/p>\n<blockquote>\n<p><strong>Note!<\/strong> You do not <strong>have<\/strong> to follow the migration path. Considering all the new things that GA4 data model enables, it might make sense to upgrade from Enhanced Ecommerce to GA4 and not resort to using the \u201cold\u201d data schema in your setup.<\/p>\n<\/blockquote>\n<p>I\u2019ve built a <a href=\"https:\/\/www.simoahava.com\/custom-templates\/eec-products-ga4-items\/\">custom variable template<\/a> that you can also use to map an Enhanced Ecommerce <code>products<\/code> (or <code>impressions<\/code> or <code>promotions<\/code>) object to its GA4 counterpart. It has some additional bells and whistles, such as automatic parsing of a multi-level product category into the five separate <code>item_category<\/code> parameters, and a table that lets you map Enhanced Ecommerce\u2019s product-scoped custom dimensions to custom item parameters in the GA4 <code>items<\/code> objects.<\/p>\n<h3 id=\"event-names\">Event names<\/h3>\n<p>One of the key features of Google Analytics 4 is how it utilizes the <strong>event name<\/strong> to carry quite a bit of semantic weight. To see the list of event names associated with Ecommerce collection, see the chapter <a href=\"#available-actions\">Available actions<\/a> above.<\/p>\n<div style=\"aspect-ratio: 1780 \/ 720;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/checkout-event.jpg\" title=\"Checkout event\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"720\" width=\"1780\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/checkout-event.jpg#ZgotmplZ\" alt=\"Checkout event\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>When building the tags to send the Ecommerce data to GA4, you need to make sure that the <strong>Event name<\/strong> field is always set to the correct value. A typo or a mismatch between the event name and the parameter map will lead to data quality issues that are impossible to fix retroactively.<\/p>\n<h3 id=\"setting-the-fields\">Setting the fields<\/h3>\n<p>To create an Ecommerce tag in Google Tag Manager, you need to create a new <strong>Google Analytics 4 Event<\/strong> tag.<\/p>\n<p>The first thing you need to establish is what its <strong>Configuration tag<\/strong> is. For more information about this see <a href=\"https:\/\/support.google.com\/tagmanager\/answer\/9442095?hl=en\">this article<\/a>.<\/p>\n<p>Next, you need to set the <strong>Event name<\/strong>. Whether you use a variable for this field or hard-code it, you need to be mindful of what the reserved event names for GA4 are. As you go through the <a href=\"#action-reference\">chapters below<\/a>, each sub-chapter devoted to an Ecommerce action will include details on what the event name should be for that particular action.<\/p>\n<div style=\"aspect-ratio: 1774 \/ 1032;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/purchase-hit-example.jpg\" title=\"Purchase hit example\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1032\" width=\"1774\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/purchase-hit-example.jpg#ZgotmplZ\" alt=\"Purchase hit example\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Individual parameters are set by adding them to the <strong>Event Parameters<\/strong> table. For the most part, you\u2019ll only need to add the <code>items<\/code> parameter, but some actions (such as <a href=\"#purchase\"><strong>purchase<\/strong><\/a>) require additional fields to be set.<\/p>\n<blockquote>\n<p>If you use a Data Layer variable to pull in an <code>items<\/code> array, for example, do be mindful of <strong>recursive merge<\/strong>. You might want to engineer the setup so that you always use <a href=\"https:\/\/www.simoahava.com\/gtm-tips\/data-layer-variable-versions-explained\/\">Version 1<\/a> of the Data Layer variable to avoid values \u201cleaking\u201d from one object to another.<\/p>\n<\/blockquote>\n<h3 id=\"trigger\">Trigger<\/h3>\n<p>As before, make sure you use a <strong>trigger<\/strong> on the tag that fires when the relevant Ecommerce object is pushed into <code>dataLayer<\/code>.<\/p>\n<div style=\"aspect-ratio: 1844 \/ 766;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/custom-event-trigger.jpg\" title=\"custom event trigger\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"766\" width=\"1844\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/custom-event-trigger.jpg#ZgotmplZ\" alt=\"custom event trigger\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>This means that you\u2019ll want to engineer the <code>dataLayer<\/code> so that each Ecommerce event is its own, distinct push, and each <a href=\"https:\/\/www.simoahava.com\/gtm-tips\/add-the-event-key-to-datalayer-pushes\/\">object has the <code>event<\/code> key<\/a>. This way you can create a *<em>Custom Event trigger<\/em> for this <code>event<\/code> value in order to fire the tag at the exact right moment.<\/p>\n<h3 id=\"tips-for-server-side-tagging\">Tips for server-side tagging<\/h3>\n<p>One possible path of migration from Enhanced Ecommerce to GA4 is to handle the logic in your <a href=\"https:\/\/www.simoahava.com\/analytics\/server-side-tagging-google-tag-manager\/\">server-side tagging setup<\/a>.<\/p>\n<p>Obviously, it\u2019s not a suitable option for everyone (as there are costs involved), but it would provide a pretty sleek path to having the single Universal Analytics stream sent to the server-side container be fanned out to not just the Universal Analytics endpoint but also to GA4.<\/p>\n<p>When you send a Universal Analytics Enhanced Ecommerce event to a server container, the built-in Universal Analytics <strong>client<\/strong> chops it up and outputs an <a href=\"https:\/\/www.simoahava.com\/analytics\/server-side-tagging-google-tag-manager\/#event-model\">event data object<\/a> like this:<\/p>\n<div style=\"aspect-ratio: 1726 \/ 2050;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/event-data-server-side.jpg\" title=\"Event data server-side\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"2050\" width=\"1726\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/event-data-server-side.jpg#ZgotmplZ\" alt=\"Event data server-side\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>As you can see, the model chops up the Enhanced Ecommerce payload in the Measurement Protocol request and outputs the values into standard event parameters. Notably, product-scoped custom dimensions <strong>are not<\/strong> mapped to the <code>items<\/code> array.<\/p>\n<p>You could thus fire a GA4 tag in the server container with the Universal Analytics client, and it will send a well-formed event to GA4. You\u2019d just need to edit the <code>event_name<\/code> first, as <code>page_view<\/code> would not be the correct name for a purchase. You\u2019ll also need to add the correct <strong>Measurement ID<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1824 \/ 1088;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/ga4-purchase-tag.jpg\" title=\"GA4 Purchase Tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1088\" width=\"1824\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/ga4-purchase-tag.jpg#ZgotmplZ\" alt=\"GA4 Purchase Tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The challenge is, again, creating a custom mapping of the <code>items<\/code> array, as the Server container does not currently let you run JavaScript variables.<\/p>\n<p>You <em>could<\/em> build a <a href=\"https:\/\/www.simoahava.com\/analytics\/server-side-tagging-google-tag-manager\/#custom-templates\">custom tag template<\/a> in server-side tagging, but it might be better to just wait for Google to improve the migration path.<\/p>\n<h2 id=\"action-reference\">Action reference<\/h2>\n<p>The following chapters outline how to instrument the <code>dataLayer<\/code> and the Google Tag Manager tags to measure Ecommerce actions in GA4.<\/p>\n<p>Included with each action chapter is an example of how a <strong>migration<\/strong> setup from Universal Analytics to GA4 might work.<\/p>\n<blockquote>\n<p>I want to reiterate that instead of using the Universal Analytics <code>dataLayer<\/code>, you should either engineer or <em>plan<\/em> to engineer the <code>dataLayer<\/code> so it\u2019s compatible with the new actions and item parameters that GA4 offers.<\/p>\n<\/blockquote>\n<h3 id=\"view_promotion\">view_promotion<\/h3>\n<p>A <code>view_promotion<\/code> event is sent when the user sees one or more <strong>promotion<\/strong> items on the page. Promotions are a different data model from the rest of GA4 Ecommerce, as they do not necessarily involve products at all, but rather banners, campaigns, and such.<\/p>\n<h4 id=\"data-layer-composition\">Data Layer composition<\/h4>\n<p>A sample <code>dataLayer<\/code> object for the <code>view_promotion<\/code> event could look like this (adapted from the <a href=\"https:\/\/developers.google.com\/tag-manager\/ecommerce-ga4#measure_promotion_viewsimpressions\">official documentation<\/a>):<\/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\">'view_promotion'<\/span>,\n  ecommerce: {\n    items: [{\n      promotion_id: <span style=\"color:#a50\">'sc2021'<\/span>,\n      promotion_name: <span style=\"color:#a50\">'summer_campaign_2021'<\/span>,\n      creative_name: <span style=\"color:#a50\">'family_in_bathing_suits_1'<\/span>,\n      creative_slot: <span style=\"color:#a50\">'featured_items'<\/span>,\n      location_id: <span style=\"color:#a50\">'ChIJ4Us9pPryjUYRn1MzXbSQuPA'<\/span>\n    },{\n      promotion_id: <span style=\"color:#a50\">'wc2020'<\/span>,\n      promotion_name: <span style=\"color:#a50\">'winter_campaign_2020'<\/span>,\n      creative_name: <span style=\"color:#a50\">'family_in_winter_clothes_1'<\/span>,\n      creative_slot: <span style=\"color:#a50\">'featured_items_2'<\/span>,\n      location_id: <span style=\"color:#a50\">'ChIJ4Us9pPryjUYRn1MzXbSQuPA'<\/span>\n    }]\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p><strong>Required<\/strong> parameters are <strong>either<\/strong> <code>promotion_id<\/code> <strong>or<\/strong> <code>promotion_name<\/code>.<\/p>\n<blockquote>\n<p>The example in the documentation shows also <code>item<\/code> parameters set in the promotion view object. This is something you might consider adding if the promotion is clearly related to an item or a specific set of items. The current suite of Ecommerce reports doesn\u2019t seem to have any options for viewing items in a promotion, but the export to BigQuery would include this information.<\/p>\n<\/blockquote>\n<h4 id=\"migration-from-enhanced-ecommerce\">Migration from Enhanced Ecommerce<\/h4>\n<p>If you want to use the Enhanced Ecommerce <code>promotions<\/code> array instead of creating a new <code>items<\/code> object, you need to create the following variable:<\/p>\n<ul>\n<li><strong>Type<\/strong>: Data Layer Variable<\/li>\n<li><strong>Data Layer Variable name<\/strong>: <code>ecommerce.promoView.promotions<\/code><\/li>\n<li><strong>Data Layer Version<\/strong>: Version 2<\/li>\n<\/ul>\n<p>Then you can add it to your GA4 <code>view_promotion<\/code> event tag as the value of the <code>items<\/code> field (see the next chapter).<\/p>\n<blockquote>\n<p>You can also use my <a href=\"https:\/\/www.simoahava.com\/custom-templates\/eec-products-ga4-items\/\">custom variable template<\/a> to convert an Enhanced Ecommerce <code>promotions<\/code> object automatically to the format required by <code>view_promotion<\/code>.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration\">Tag configuration<\/h4>\n<p>The tag for <code>view_promotion<\/code> would look like this:<\/p>\n<div style=\"aspect-ratio: 1802 \/ 1208;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/view-promotion-tag.jpg\" title=\"view_promotion tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1208\" width=\"1802\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/view-promotion-tag.jpg#ZgotmplZ\" alt=\"view_promotion tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Make sure you set the <strong>Event Name<\/strong> field to <code>view_promotion<\/code>.<\/p>\n<p>Make sure you point the <code>items<\/code> parameter to a Data Layer variable that contains the <code>items<\/code> array. This would be:<\/p>\n<ul>\n<li><code>ecommerce.items<\/code> if you\u2019re following the steps outlined <a href=\"#data-layer-composition\">here<\/a>.<\/li>\n<li><code>ecommerce.promoView.promotions<\/code> if you\u2019ve chosen to <a href=\"#migration-from-enhanced-ecommerce\">migrate<\/a> from Enhanced Ecommerce.<\/li>\n<\/ul>\n<p>Remember also to set <strong>the trigger<\/strong> to a Custom Event trigger, set to the value of the <code>event<\/code> key in the object that was pushed to <code>dataLayer<\/code> (in the example <a href=\"#data-layer-composition\">above<\/a>, it would be <code>view_promotion<\/code>).<\/p>\n<h3 id=\"select_promotion\">select_promotion<\/h3>\n<p>The <code>select_promotion<\/code> event is sent when the user <strong>clicks<\/strong> or <strong>selects<\/strong> one of the promotions they viewed.<\/p>\n<h4 id=\"data-layer-composition-1\">Data Layer composition<\/h4>\n<p>A sample <code>dataLayer<\/code> object for the <code>select_promotion<\/code> event could look like this (adapted from the <a href=\"https:\/\/developers.google.com\/tag-manager\/ecommerce-ga4#measure_promotion_clicks\">official documentation<\/a>):<\/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\">'select_promotion'<\/span>,\n  ecommerce: {\n    items: [{\n      promotion_id: <span style=\"color:#a50\">'sc2021'<\/span>,\n      promotion_name: <span style=\"color:#a50\">'summer_campaign_2021'<\/span>,\n      creative_name: <span style=\"color:#a50\">'family_in_bathing_suits_1'<\/span>,\n      creative_slot: <span style=\"color:#a50\">'featured_items'<\/span>,\n      location_id: <span style=\"color:#a50\">'ChIJ4Us9pPryjUYRn1MzXbSQuPA'<\/span>\n    }]\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p><strong>Required<\/strong> parameters are <strong>either<\/strong> <code>promotion_id<\/code> <strong>or<\/strong> <code>promotion_name<\/code>.<\/p>\n<h4 id=\"migration-from-enhanced-ecommerce-1\">Migration from Enhanced Ecommerce<\/h4>\n<p>If you want to use the Enhanced Ecommerce <code>promotions<\/code> array instead of creating a new <code>items<\/code> object, you need to create the following variable:<\/p>\n<ul>\n<li><strong>Type<\/strong>: Data Layer Variable<\/li>\n<li><strong>Data Layer Variable name<\/strong>: <code>ecommerce.promoClick.promotions<\/code><\/li>\n<li><strong>Data Layer Version<\/strong>: Version 2<\/li>\n<\/ul>\n<p>Then you can add it to your GA4 <code>select_promotion<\/code> event tag as the value of the <code>items<\/code> field (see the next chapter).<\/p>\n<blockquote>\n<p>You can also use my <a href=\"https:\/\/www.simoahava.com\/custom-templates\/eec-products-ga4-items\/\">custom variable template<\/a> to convert an Enhanced Ecommerce <code>promotions<\/code> object automatically to the format required by <code>select_promotion<\/code>.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-1\">Tag configuration<\/h4>\n<p>The tag for <code>select_promotion<\/code> would look like this:<\/p>\n<div style=\"aspect-ratio: 1806 \/ 1206;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/select-promotion-tag.jpg\" title=\"Select promotion tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1206\" width=\"1806\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/select-promotion-tag.jpg#ZgotmplZ\" alt=\"Select promotion tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Make sure you set the <strong>Event Name<\/strong> field to <code>select_promotion<\/code>.<\/p>\n<p>Make sure you point the <code>items<\/code> parameter to a Data Layer variable that contains the <code>items<\/code> array. This would be:<\/p>\n<ul>\n<li><code>ecommerce.items<\/code> if you\u2019re following the steps outlined <a href=\"#data-layer-composition-1\">here<\/a>.<\/li>\n<li><code>ecommerce.promoClick.promotions<\/code> if you\u2019ve chosen to <a href=\"#migration-from-enhanced-ecommerce-1\">migrate<\/a> from Enhanced Ecommerce.<\/li>\n<\/ul>\n<p>Remember also to set <strong>the trigger<\/strong> to a Custom Event trigger, set to the value of the <code>event<\/code> key in the object that was pushed to <code>dataLayer<\/code> (in the example <a href=\"#data-layer-composition-1\">above<\/a>, it would be <code>select_promotion<\/code>).<\/p>\n<h3 id=\"view_item_list\">view_item_list<\/h3>\n<p>The <code>view_item_list<\/code> event is sent when the user sees a list of items in a dedicated product list. A product list could be something like search results, featured items, upsell items, and so forth.<\/p>\n<h4 id=\"data-layer-composition-2\">Data Layer composition<\/h4>\n<p>A sample <code>dataLayer<\/code> object for the <code>view_item_list<\/code> event could look like this (adapted from the <a href=\"https:\/\/developers.google.com\/tag-manager\/ecommerce-ga4#measure_productitem_list_viewsimpressions\">official documentation<\/a>):<\/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\">'view_item_list'<\/span>,\n  ecommerce: {\n    items: [{\n      item_name: <span style=\"color:#a50\">'Finnish magical parka'<\/span>,\n      item_id: <span style=\"color:#a50\">'mp1122'<\/span>,\n      price: <span style=\"color:#a50\">'31.10'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Coats'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Parkas'<\/span>,\n      item_category4: <span style=\"color:#a50\">'Unisex'<\/span>,\n      item_variant: <span style=\"color:#a50\">'Navy blue'<\/span>,\n      item_list_name: <span style=\"color:#a50\">'Featured items'<\/span>,\n      item_list_id: <span style=\"color:#a50\">'FI1'<\/span>,\n      index: <span style=\"color:#099\">1<\/span>,\n      quantity: <span style=\"color:#a50\">'1'<\/span>\n    },{\n      item_name: <span style=\"color:#a50\">'Swedish regular parka'<\/span>,\n      item_id: <span style=\"color:#a50\">'sp2323'<\/span>,\n      price: <span style=\"color:#a50\">'92.00'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Coats'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Parkas'<\/span>,\n      item_category4: <span style=\"color:#a50\">'Unisex'<\/span>,\n      item_variant: <span style=\"color:#a50\">'Black'<\/span>,\n      item_list_name: <span style=\"color:#a50\">'Featured items'<\/span>,\n      item_list_id: <span style=\"color:#a50\">'FI1'<\/span>,\n      index: <span style=\"color:#099\">2<\/span>,\n      quantity: <span style=\"color:#a50\">'1'<\/span>\n    }]\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p><strong>Required<\/strong> parameters are <strong>either<\/strong> <code>item_name<\/code> <strong>or<\/strong> <code>item_id<\/code>. Note that you should always try to populate the <code>item_list_name<\/code> field so that you know which list was viewed.<\/p>\n<h4 id=\"migration-from-enhanced-ecommerce-2\">Migration from Enhanced Ecommerce<\/h4>\n<p>If you want to use the Enhanced Ecommerce <code>impressions<\/code> array instead of creating a new <code>items<\/code> object, you need to create the following variable:<\/p>\n<ul>\n<li><strong>Type<\/strong>: Data Layer Variable<\/li>\n<li><strong>Data Layer Variable name<\/strong>: <code>ecommerce.impressions<\/code><\/li>\n<li><strong>Data Layer Version<\/strong>: Version 2<\/li>\n<\/ul>\n<p>Then you can add it to your GA4 <code>view_item_list<\/code> event tag as the value of the <code>items<\/code> field (see the next chapter).<\/p>\n<blockquote>\n<p>You can also use my <a href=\"https:\/\/www.simoahava.com\/custom-templates\/eec-products-ga4-items\/\">custom variable template<\/a> to convert an Enhanced Ecommerce <code>impressions<\/code> object automatically to the format required by <code>view_item_list<\/code>.<\/p>\n<\/blockquote>\n<p><strong>Note!<\/strong> If you\u2019re bundling <code>impressions<\/code> with some other Enhanced Ecommerce action (as you might commonly do), the custom variable template will not really work, as it always looks for the <code>products<\/code> array first.<\/p>\n<h4 id=\"tag-configuration-2\">Tag configuration<\/h4>\n<p>The tag for <code>view_item_list<\/code> would look like this:<\/p>\n<div style=\"aspect-ratio: 1796 \/ 1310;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/view-item-list-tag.jpg\" title=\"View item list\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1310\" width=\"1796\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/view-item-list-tag.jpg#ZgotmplZ\" alt=\"View item list\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Make sure you set the <strong>Event Name<\/strong> field to <code>view_item_list<\/code>.<\/p>\n<p>Make sure you point the <code>items<\/code> parameter to a Data Layer variable that contains the <code>items<\/code> array. This would be:<\/p>\n<ul>\n<li><code>ecommerce.items<\/code> if you\u2019re following the steps outlined <a href=\"#data-layer-composition-2\">here<\/a>.<\/li>\n<li><code>ecommerce.impressions<\/code> if you\u2019ve chosen to <a href=\"#migration-from-enhanced-ecommerce-2\">migrate<\/a> from Enhanced Ecommerce.<\/li>\n<\/ul>\n<p>Remember also to set <strong>the trigger<\/strong> to a Custom Event trigger, set to the value of the <code>event<\/code> key in the object that was pushed to <code>dataLayer<\/code> (in the example <a href=\"#data-layer-composition-2\">above<\/a>, it would be <code>view_item_list<\/code>).<\/p>\n<h3 id=\"select_item\">select_item<\/h3>\n<p>The <code>select_item<\/code> event is sent when the user actually <strong>clicks<\/strong> or <strong>selects<\/strong> an item after viewing the item\u2019s impression(s) in a list.<\/p>\n<h4 id=\"data-layer-composition-3\">Data Layer composition<\/h4>\n<p>A sample <code>dataLayer<\/code> object for the <code>select_item<\/code> event could look like this (adapted from the <a href=\"https:\/\/developers.google.com\/tag-manager\/ecommerce-ga4#measure_productitem_list_clicks\">official documentation<\/a>):<\/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\">'select_item'<\/span>,\n  ecommerce: {\n    items: [{\n      item_name: <span style=\"color:#a50\">'Finnish magical parka'<\/span>,\n      item_id: <span style=\"color:#a50\">'mp1122'<\/span>,\n      price: <span style=\"color:#a50\">'31.10'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Coats'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Parkas'<\/span>,\n      item_category4: <span style=\"color:#a50\">'Unisex'<\/span>,\n      item_variant: <span style=\"color:#a50\">'Navy blue'<\/span>,\n      item_list_name: <span style=\"color:#a50\">'Featured items'<\/span>,\n      item_list_id: <span style=\"color:#a50\">'FI1'<\/span>,\n      index: <span style=\"color:#099\">1<\/span>,\n      quantity: <span style=\"color:#a50\">'1'<\/span>\n    }]\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p><strong>Required<\/strong> parameters are <strong>either<\/strong> <code>item_name<\/code> <strong>or<\/strong> <code>item_id<\/code>. Note that you should always try to populate the <code>item_list_name<\/code> field so that you know which list was the target of the click.<\/p>\n<h4 id=\"migration-from-enhanced-ecommerce-3\">Migration from Enhanced Ecommerce<\/h4>\n<p>If you want to use the Enhanced Ecommerce <code>products<\/code> array instead of creating a new <code>items<\/code> object, you need to create the following variable:<\/p>\n<ul>\n<li><strong>Type<\/strong>: Data Layer Variable<\/li>\n<li><strong>Data Layer Variable name<\/strong>: <code>ecommerce.click.products<\/code><\/li>\n<li><strong>Data Layer Version<\/strong>: Version 2<\/li>\n<\/ul>\n<p>Then you can add it to your GA4 <code>select_item<\/code> event tag as the value of the <code>items<\/code> field (see the next chapter).<\/p>\n<blockquote>\n<p>You can also use my <a href=\"https:\/\/www.simoahava.com\/custom-templates\/eec-products-ga4-items\/\">custom variable template<\/a> to convert an Enhanced Ecommerce <code>products<\/code> object automatically to the format required by <code>select_item<\/code>.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-3\">Tag configuration<\/h4>\n<p>The tag for <code>select_item<\/code> would look like this:<\/p>\n<div style=\"aspect-ratio: 1800 \/ 1226;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/select-item-tag.jpg\" title=\"Select itemt ag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1226\" width=\"1800\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/select-item-tag.jpg#ZgotmplZ\" alt=\"Select itemt ag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Make sure you set the <strong>Event Name<\/strong> field to <code>select_item<\/code>.<\/p>\n<p>Make sure you point the <code>items<\/code> parameter to a Data Layer variable that contains the <code>items<\/code> array. This would be:<\/p>\n<ul>\n<li><code>ecommerce.items<\/code> if you\u2019re following the steps outlined <a href=\"#data-layer-composition-3\">here<\/a>.<\/li>\n<li><code>ecommerce.click.products<\/code> if you\u2019ve chosen to <a href=\"#migration-from-enhanced-ecommerce-3\">migrate<\/a> from Enhanced Ecommerce.<\/li>\n<\/ul>\n<p>Remember also to set <strong>the trigger<\/strong> to a Custom Event trigger, set to the value of the <code>event<\/code> key in the object that was pushed to <code>dataLayer<\/code> (in the example <a href=\"#data-layer-composition-3\">above<\/a>, it would be <code>select_item<\/code>).<\/p>\n<h3 id=\"view_item\">view_item<\/h3>\n<p>The <code>view_item<\/code> event is sent when the user views the <strong>details<\/strong> of any given product.<\/p>\n<h4 id=\"data-layer-composition-4\">Data Layer composition<\/h4>\n<p>A sample <code>dataLayer<\/code> object for the <code>view_item<\/code> event could look like this (adapted from the <a href=\"https:\/\/developers.google.com\/tag-manager\/ecommerce-ga4#measure_viewsimpressions_of_productitem_details\">official documentation<\/a>):<\/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\">'view_item'<\/span>,\n  ecommerce: {\n    items: [{\n      item_name: <span style=\"color:#a50\">'Finnish magical parka'<\/span>,\n      item_id: <span style=\"color:#a50\">'mp1122'<\/span>,\n      price: <span style=\"color:#a50\">'31.10'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Coats'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Parkas'<\/span>,\n      item_category4: <span style=\"color:#a50\">'Unisex'<\/span>,\n      item_variant: <span style=\"color:#a50\">'Navy blue'<\/span>,\n      quantity: <span style=\"color:#a50\">'1'<\/span>\n    }]\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p><strong>Required<\/strong> parameters are <strong>either<\/strong> <code>item_name<\/code> <strong>or<\/strong> <code>item_id<\/code>.<\/p>\n<p>You can also add promotion and item list parameters (e.g. <code>promotion_name<\/code> or <code>item_list_name<\/code>) to the items in the <code>items<\/code> array if you want to add credit to a promotion or an item list for the current action.<\/p>\n<h4 id=\"migration-from-enhanced-ecommerce-4\">Migration from Enhanced Ecommerce<\/h4>\n<p>If you want to use the Enhanced Ecommerce <code>products<\/code> array instead of creating a new <code>items<\/code> object, you need to create the following variable:<\/p>\n<ul>\n<li><strong>Type<\/strong>: Data Layer Variable<\/li>\n<li><strong>Data Layer Variable name<\/strong>: <code>ecommerce.detail.products<\/code><\/li>\n<li><strong>Data Layer Version<\/strong>: Version 2<\/li>\n<\/ul>\n<p>Then you can add it to your GA4 <code>view_item<\/code> event tag as the value of the <code>items<\/code> field (see the next chapter).<\/p>\n<blockquote>\n<p>You can also use my <a href=\"https:\/\/www.simoahava.com\/custom-templates\/eec-products-ga4-items\/\">custom variable template<\/a> to convert an Enhanced Ecommerce <code>products<\/code> object automatically to the format required by <code>view_item<\/code>.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-4\">Tag configuration<\/h4>\n<p>The tag for <code>view_item<\/code> would look like this:<\/p>\n<div style=\"aspect-ratio: 1800 \/ 1216;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/view-item-tag.jpg\" title=\"view_item tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1216\" width=\"1800\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/view-item-tag.jpg#ZgotmplZ\" alt=\"view_item tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Make sure you set the <strong>Event Name<\/strong> field to <code>view_item<\/code>.<\/p>\n<p>Make sure you point the <code>items<\/code> parameter to a Data Layer variable that contains the <code>items<\/code> array. This would be:<\/p>\n<ul>\n<li><code>ecommerce.items<\/code> if you\u2019re following the steps outlined <a href=\"#data-layer-composition-4\">here<\/a>.<\/li>\n<li><code>ecommerce.detail.products<\/code> if you\u2019ve chosen to <a href=\"#migration-from-enhanced-ecommerce-4\">migrate<\/a> from Enhanced Ecommerce.<\/li>\n<\/ul>\n<blockquote>\n<p>You can add additional parameters (in addition to <code>items<\/code>) such as <code>promotion_name<\/code> or <code>item_list_name<\/code> if you want to associate this event with a promotion or an item list, respectively.<\/p>\n<\/blockquote>\n<p>Remember also to set <strong>the trigger<\/strong> to a Custom Event trigger, set to the value of the <code>event<\/code> key in the object that was pushed to <code>dataLayer<\/code> (in the example <a href=\"#data-layer-composition-4\">above<\/a>, it would be <code>view_item<\/code>).<\/p>\n<h3 id=\"add_to_cart\">add_to_cart<\/h3>\n<p>The <code>add_to_cart<\/code> event is sent when the user <strong>adds<\/strong> a product to the cart, either by adding a new product to the cart or by increasing the quantity of an existing item in the cart.<\/p>\n<h4 id=\"data-layer-composition-5\">Data Layer composition<\/h4>\n<p>A sample <code>dataLayer<\/code> object for the <code>add_to_cart<\/code> event could look like this (adapted from the <a href=\"https:\/\/developers.google.com\/tag-manager\/ecommerce-ga4#measure_additions_or_removals_from_a_shopping_cart\">official documentation<\/a>):<\/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\">'add_to_cart'<\/span>,\n  ecommerce: {\n    items: [{\n      item_name: <span style=\"color:#a50\">'Finnish magical parka'<\/span>,\n      item_id: <span style=\"color:#a50\">'mp1122'<\/span>,\n      price: <span style=\"color:#a50\">'31.10'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Coats'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Parkas'<\/span>,\n      item_category4: <span style=\"color:#a50\">'Unisex'<\/span>,\n      item_variant: <span style=\"color:#a50\">'Navy blue'<\/span>,\n      quantity: <span style=\"color:#a50\">'1'<\/span>\n    }]\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p><strong>Required<\/strong> parameters are <strong>either<\/strong> <code>item_name<\/code> <strong>or<\/strong> <code>item_id<\/code>. Set <code>quantity<\/code> to reflect the number of items <em>added<\/em> to the cart in this action.<\/p>\n<p>You can also add promotion and item list parameters (e.g. <code>promotion_name<\/code> or <code>item_list_name<\/code>) to the items in the <code>items<\/code> array if you want to add credit to a promotion or an item list for the current action.<\/p>\n<h4 id=\"migration-from-enhanced-ecommerce-5\">Migration from Enhanced Ecommerce<\/h4>\n<p>If you want to use the Enhanced Ecommerce <code>products<\/code> array instead of creating a new <code>items<\/code> object, you need to create the following variable:<\/p>\n<ul>\n<li><strong>Type<\/strong>: Data Layer Variable<\/li>\n<li><strong>Data Layer Variable name<\/strong>: <code>ecommerce.add.products<\/code><\/li>\n<li><strong>Data Layer Version<\/strong>: Version 2<\/li>\n<\/ul>\n<p>Then you can add it to your GA4 <code>add_to_cart<\/code> event tag as the value of the <code>items<\/code> field (see the next chapter).<\/p>\n<blockquote>\n<p>You can also use my <a href=\"https:\/\/www.simoahava.com\/custom-templates\/eec-products-ga4-items\/\">custom variable template<\/a> to convert an Enhanced Ecommerce <code>products<\/code> object automatically to the format required by <code>add_to_cart<\/code>.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-5\">Tag configuration<\/h4>\n<p>The tag for <code>add_to_cart<\/code> would look like this:<\/p>\n<div style=\"aspect-ratio: 1798 \/ 1214;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/add-to-cart-tag.jpg\" title=\"add_to_cart tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1214\" width=\"1798\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/add-to-cart-tag.jpg#ZgotmplZ\" alt=\"add_to_cart tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Make sure you set the <strong>Event Name<\/strong> field to <code>add_to_cart<\/code>.<\/p>\n<p>Make sure you point the <code>items<\/code> parameter to a Data Layer variable that contains the <code>items<\/code> array. This would be:<\/p>\n<ul>\n<li><code>ecommerce.items<\/code> if you\u2019re following the steps outlined <a href=\"#data-layer-composition-5\">here<\/a>.<\/li>\n<li><code>ecommerce.add.products<\/code> if you\u2019ve chosen to <a href=\"#migration-from-enhanced-ecommerce-5\">migrate<\/a> from Enhanced Ecommerce.<\/li>\n<\/ul>\n<p>Remember also to set <strong>the trigger<\/strong> to a Custom Event trigger, set to the value of the <code>event<\/code> key in the object that was pushed to <code>dataLayer<\/code> (in the example <a href=\"#data-layer-composition-5\">above<\/a>, it would be <code>add_to_cart<\/code>).<\/p>\n<blockquote>\n<p>You can add additional parameters (in addition to <code>items<\/code>) such as <code>promotion_name<\/code> or <code>item_list_name<\/code> if you want to associate this event with a promotion or an item list, respectively.<\/p>\n<\/blockquote>\n<h3 id=\"add_to_wishlist\">add_to_wishlist<\/h3>\n<p>The <code>add_to_wishlist<\/code> event is sent when the user adds a product to a <strong>wishlist<\/strong>.<\/p>\n<blockquote>\n<p>This does <strong>not<\/strong> have an analogy in Enhanced Ecommerce. It\u2019s a completely new Ecommerce event type.<\/p>\n<\/blockquote>\n<h4 id=\"data-layer-composition-6\">Data Layer composition<\/h4>\n<p>A sample <code>dataLayer<\/code> object for the <code>add_to_wishlist<\/code> event could 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\">'add_to_wishlist'<\/span>,\n  ecommerce: {\n    items: [{\n      item_name: <span style=\"color:#a50\">'Finnish magical parka'<\/span>,\n      item_id: <span style=\"color:#a50\">'mp1122'<\/span>,\n      price: <span style=\"color:#a50\">'31.10'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Coats'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Parkas'<\/span>,\n      item_category4: <span style=\"color:#a50\">'Unisex'<\/span>,\n      item_variant: <span style=\"color:#a50\">'Navy blue'<\/span>,\n      quantity: <span style=\"color:#a50\">'1'<\/span>\n    }]\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p><strong>Required<\/strong> parameters are <strong>either<\/strong> <code>item_name<\/code> <strong>or<\/strong> <code>item_id<\/code>.<\/p>\n<p>You can also add promotion and item list parameters (e.g. <code>promotion_name<\/code> or <code>item_list_name<\/code>) to the items in the <code>items<\/code> array if you want to add credit to a promotion or an item list for the current action.<\/p>\n<h4 id=\"tag-configuration-6\">Tag configuration<\/h4>\n<p>The tag for <code>add_to_wishlist<\/code> would look like this:<\/p>\n<div style=\"aspect-ratio: 1802 \/ 1224;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/add-to-wishlist-tag.jpg\" title=\"Add to wishlist\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1224\" width=\"1802\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/add-to-wishlist-tag.jpg#ZgotmplZ\" alt=\"Add to wishlist\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Make sure you set the <strong>Event Name<\/strong> field to <code>add_to_wishlist<\/code>.<\/p>\n<p>Make sure you point the <code>items<\/code> parameter to a Data Layer variable that contains the <code>items<\/code> array. This would be <code>ecommerce.items<\/code> if you\u2019re following the steps outlined <a href=\"#data-layer-composition-6\">here<\/a>.<\/p>\n<p>Remember also to set <strong>the trigger<\/strong> to a Custom Event trigger, set to the value of the <code>event<\/code> key in the object that was pushed to <code>dataLayer<\/code> (in the example <a href=\"#data-layer-composition-6\">above<\/a>, it would be <code>add_to_wishlist<\/code>).<\/p>\n<blockquote>\n<p>You can add additional parameters (in addition to <code>items<\/code>) such as <code>promotion_name<\/code> or <code>item_list_name<\/code> if you want to associate this event with a promotion or an item list, respectively.<\/p>\n<\/blockquote>\n<h3 id=\"remove_from_cart\">remove_from_cart<\/h3>\n<p>The <code>remove_from_cart<\/code> event is sent when the user <em>removes<\/em> something from the cart or <em>decreases the quantity<\/em> of an item in the cart.<\/p>\n<h4 id=\"data-layer-composition-7\">Data Layer composition<\/h4>\n<p>A sample <code>dataLayer<\/code> object for the <code>remove_from_cart<\/code> event could look like this (adapted from the <a href=\"https:\/\/developers.google.com\/tag-manager\/ecommerce-ga4#remove_a_product_from_a_shopping_cart\">official documentation<\/a>):<\/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\">'remove_from_cart'<\/span>,\n  ecommerce: {\n    items: [{\n      item_name: <span style=\"color:#a50\">'Finnish magical parka'<\/span>,\n      item_id: <span style=\"color:#a50\">'mp1122'<\/span>,\n      price: <span style=\"color:#a50\">'31.10'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Coats'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Parkas'<\/span>,\n      item_category4: <span style=\"color:#a50\">'Unisex'<\/span>,\n      item_variant: <span style=\"color:#a50\">'Navy blue'<\/span>,\n      quantity: <span style=\"color:#a50\">'1'<\/span>\n    }]\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p><strong>Required<\/strong> parameters are <strong>either<\/strong> <code>item_name<\/code> <strong>or<\/strong> <code>item_id<\/code>.<\/p>\n<p>You can also add promotion and item list parameters (e.g. <code>promotion_name<\/code> or <code>item_list_name<\/code>) to the items in the <code>items<\/code> array if you want to add credit to a promotion or an item list for the current action.<\/p>\n<h4 id=\"migration-from-enhanced-ecommerce-6\">Migration from Enhanced Ecommerce<\/h4>\n<p>If you want to use the Enhanced Ecommerce <code>products<\/code> array instead of creating a new <code>items<\/code> object, you need to create the following variable:<\/p>\n<ul>\n<li><strong>Type<\/strong>: Data Layer Variable<\/li>\n<li><strong>Data Layer Variable name<\/strong>: <code>ecommerce.remove.products<\/code><\/li>\n<li><strong>Data Layer Version<\/strong>: Version 2<\/li>\n<\/ul>\n<p>Then you can add it to your GA4 <code>remove_from_cart<\/code> event tag as the value of the <code>items<\/code> field (see the next chapter).<\/p>\n<blockquote>\n<p>You can also use my <a href=\"https:\/\/www.simoahava.com\/custom-templates\/eec-products-ga4-items\/\">custom variable template<\/a> to convert an Enhanced Ecommerce <code>products<\/code> object automatically to the format required by <code>remove_from_cart<\/code>.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-7\">Tag configuration<\/h4>\n<p>The tag for <code>remove_from_cart<\/code> would look like this:<\/p>\n<div style=\"aspect-ratio: 1798 \/ 1210;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/remove-from-cart-tag.jpg\" title=\"remove_from_cart tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1210\" width=\"1798\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/remove-from-cart-tag.jpg#ZgotmplZ\" alt=\"remove_from_cart tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Make sure you set the <strong>Event Name<\/strong> field to <code>remove_from_cart<\/code>.<\/p>\n<p>Make sure you point the <code>items<\/code> parameter to a Data Layer variable that contains the <code>items<\/code> array. This would be:<\/p>\n<ul>\n<li><code>ecommerce.items<\/code> if you\u2019re following the steps outlined <a href=\"#data-layer-composition-7\">here<\/a>.<\/li>\n<li><code>ecommerce.remove.products<\/code> if you\u2019ve chosen to <a href=\"#migration-from-enhanced-ecommerce-7\">migrate<\/a> from Enhanced Ecommerce.<\/li>\n<\/ul>\n<p>Remember also to set <strong>the trigger<\/strong> to a Custom Event trigger, set to the value of the <code>event<\/code> key in the object that was pushed to <code>dataLayer<\/code> (in the example <a href=\"#data-layer-composition-7\">above<\/a>, it would be <code>remove_from_cart<\/code>).<\/p>\n<blockquote>\n<p>You can add additional parameters (in addition to <code>items<\/code>) such as <code>promotion_name<\/code> or <code>item_list_name<\/code> if you want to associate this event with a promotion or an item list, respectively.<\/p>\n<\/blockquote>\n<h3 id=\"view_cart\">view_cart<\/h3>\n<p>The <code>view_cart<\/code> event is sent when the user views the cart contents.<\/p>\n<blockquote>\n<p>This does <strong>not<\/strong> have an analogy in Enhanced Ecommerce. It\u2019s a completely new Ecommerce event type.<\/p>\n<\/blockquote>\n<h4 id=\"data-layer-composition-8\">Data Layer composition<\/h4>\n<p>A sample <code>dataLayer<\/code> object for the <code>view_cart<\/code> event could 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\">'view_cart'<\/span>,\n  ecommerce: {\n    items: [{\n      item_name: <span style=\"color:#a50\">'Finnish magical parka'<\/span>,\n      item_id: <span style=\"color:#a50\">'mp1122'<\/span>,\n      price: <span style=\"color:#a50\">'31.10'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Coats'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Parkas'<\/span>,\n      item_category4: <span style=\"color:#a50\">'Unisex'<\/span>,\n      item_variant: <span style=\"color:#a50\">'Navy blue'<\/span>,\n      quantity: <span style=\"color:#a50\">'3'<\/span>\n    },{\n      item_name: <span style=\"color:#a50\">'Parka stain removal'<\/span>,\n      item_id: <span style=\"color:#a50\">'psr1332'<\/span>,\n      price: <span style=\"color:#a50\">'5.99'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Utility'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Care product'<\/span>,\n      quantity: <span style=\"color:#a50\">'1'<\/span>\n    }]\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p><strong>Required<\/strong> parameters are <strong>either<\/strong> <code>item_name<\/code> <strong>or<\/strong> <code>item_id<\/code>.<\/p>\n<p>You can also add promotion and item list parameters (e.g. <code>promotion_name<\/code> or <code>item_list_name<\/code>) to the items in the <code>items<\/code> array if you want to add credit to a promotion or an item list for the current action.<\/p>\n<h4 id=\"tag-configuration-8\">Tag configuration<\/h4>\n<p>The tag for <code>view_cart<\/code> would look like this:<\/p>\n<div style=\"aspect-ratio: 1794 \/ 1208;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/view-cart-tag.jpg\" title=\"view_cart tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1208\" width=\"1794\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/view-cart-tag.jpg#ZgotmplZ\" alt=\"view_cart tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Make sure you set the <strong>Event Name<\/strong> field to <code>view_cart<\/code>.<\/p>\n<p>Make sure you point the <code>items<\/code> parameter to a Data Layer variable that contains the <code>items<\/code> array. This would be <code>ecommerce.items<\/code> if you\u2019re following the steps outlined <a href=\"#data-layer-composition-8\">here<\/a>.<\/p>\n<p>Remember also to set <strong>the trigger<\/strong> to a Custom Event trigger, set to the value of the <code>event<\/code> key in the object that was pushed to <code>dataLayer<\/code> (in the example <a href=\"#data-layer-composition-8\">above<\/a>, it would be <code>view_cart<\/code>).<\/p>\n<blockquote>\n<p>You can add additional parameters (in addition to <code>items<\/code>) such as <code>promotion_name<\/code> or <code>item_list_name<\/code> if you want to associate this event with a promotion or an item list, respectively.<\/p>\n<\/blockquote>\n<h3 id=\"begin_checkout\">begin_checkout<\/h3>\n<p>The <code>begin_checkout<\/code> event is sent when the user starts the <strong>checkout flow<\/strong>.<\/p>\n<h4 id=\"data-layer-composition-9\">Data Layer composition<\/h4>\n<p>A sample <code>dataLayer<\/code> object for the <code>begin_checkout<\/code> event could look like this (adapted from the <a href=\"https:\/\/developers.google.com\/tag-manager\/ecommerce-ga4#measure_a_checkout\">official documentation<\/a>):<\/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\">'begin_checkout'<\/span>,\n  ecommerce: {\n    items: [{\n      item_name: <span style=\"color:#a50\">'Finnish magical parka'<\/span>,\n      item_id: <span style=\"color:#a50\">'mp1122'<\/span>,\n      price: <span style=\"color:#a50\">'31.10'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Coats'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Parkas'<\/span>,\n      item_category4: <span style=\"color:#a50\">'Unisex'<\/span>,\n      item_variant: <span style=\"color:#a50\">'Navy blue'<\/span>,\n      quantity: <span style=\"color:#a50\">'3'<\/span>\n    },{\n      item_name: <span style=\"color:#a50\">'Parka stain removal'<\/span>,\n      item_id: <span style=\"color:#a50\">'psr1332'<\/span>,\n      price: <span style=\"color:#a50\">'5.99'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Utility'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Care product'<\/span>,\n      quantity: <span style=\"color:#a50\">'1'<\/span>\n    }]\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p><strong>Required<\/strong> parameters are <strong>either<\/strong> <code>item_name<\/code> <strong>or<\/strong> <code>item_id<\/code>.<\/p>\n<p>You can also add promotion and item list parameters (e.g. <code>promotion_name<\/code> or <code>item_list_name<\/code>) to the items in the <code>items<\/code> array if you want to add credit to a promotion or an item list for the current action.<\/p>\n<h4 id=\"migration-from-enhanced-ecommerce-7\">Migration from Enhanced Ecommerce<\/h4>\n<p>If you want to use the Enhanced Ecommerce <code>products<\/code> array instead of creating a new <code>items<\/code> object, you need to create the following variable:<\/p>\n<ul>\n<li><strong>Type<\/strong>: Data Layer Variable<\/li>\n<li><strong>Data Layer Variable name<\/strong>: <code>ecommerce.checkout.products<\/code><\/li>\n<li><strong>Data Layer Version<\/strong>: Version 2<\/li>\n<\/ul>\n<p>Then you can add it to your GA4 <code>begin_checkout<\/code> event tag as the value of the <code>items<\/code> field (see the next chapter).<\/p>\n<blockquote>\n<p>You can also use my <a href=\"https:\/\/www.simoahava.com\/custom-templates\/eec-products-ga4-items\/\">custom variable template<\/a> to convert an Enhanced Ecommerce <code>products<\/code> object automatically to the format required by <code>begin_checkout<\/code>.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-9\">Tag configuration<\/h4>\n<p>The tag for <code>begin_checkout<\/code> would look like this:<\/p>\n<div style=\"aspect-ratio: 1804 \/ 1222;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/begin-checkout-tag.jpg\" title=\"begin_checkout tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1222\" width=\"1804\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/begin-checkout-tag.jpg#ZgotmplZ\" alt=\"begin_checkout tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Make sure you set the <strong>Event Name<\/strong> field to <code>begin_checkout<\/code>.<\/p>\n<p>Make sure you point the <code>items<\/code> parameter to a Data Layer variable that contains the <code>items<\/code> array. This would be:<\/p>\n<ul>\n<li><code>ecommerce.items<\/code> if you\u2019re following the steps outlined <a href=\"#data-layer-composition-9\">here<\/a>.<\/li>\n<li><code>ecommerce.checkout.products<\/code> if you\u2019ve chosen to <a href=\"#migration-from-enhanced-ecommerce-9\">migrate<\/a> from Enhanced Ecommerce.<\/li>\n<\/ul>\n<p>Remember also to set <strong>the trigger<\/strong> to a Custom Event trigger, set to the value of the <code>event<\/code> key in the object that was pushed to <code>dataLayer<\/code> (in the example <a href=\"#data-layer-composition-9\">above<\/a>, it would be <code>begin_checkout<\/code>).<\/p>\n<blockquote>\n<p>You can add additional parameters (in addition to <code>items<\/code>) such as <code>promotion_name<\/code> or <code>item_list_name<\/code> if you want to associate this event with a promotion or an item list, respectively.<\/p>\n<\/blockquote>\n<h3 id=\"add_shipping_info\">add_shipping_info<\/h3>\n<p>The <code>add_shipping_info<\/code> event is sent when the user has selected a shipping method.<\/p>\n<blockquote>\n<p>While Enhanced Ecommerce doesn\u2019t have a direct analogy to <code>add_shipping_info<\/code>, most implementations have shipping method selection encoded in a <code>checkout_option<\/code> object.<\/p>\n<\/blockquote>\n<h4 id=\"data-layer-composition-10\">Data Layer composition<\/h4>\n<p>A sample <code>dataLayer<\/code> object for the <code>add_shipping_info<\/code> event could 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\">'add_shipping_info'<\/span>,\n  ecommerce: {\n    shipping_tier: <span style=\"color:#a50\">'FedEx'<\/span>,\n    items: [{\n      item_name: <span style=\"color:#a50\">'Finnish magical parka'<\/span>,\n      item_id: <span style=\"color:#a50\">'mp1122'<\/span>,\n      price: <span style=\"color:#a50\">'31.10'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Coats'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Parkas'<\/span>,\n      item_category4: <span style=\"color:#a50\">'Unisex'<\/span>,\n      item_variant: <span style=\"color:#a50\">'Navy blue'<\/span>,\n      quantity: <span style=\"color:#a50\">'3'<\/span>\n    },{\n      item_name: <span style=\"color:#a50\">'Parka stain removal'<\/span>,\n      item_id: <span style=\"color:#a50\">'psr1332'<\/span>,\n      price: <span style=\"color:#a50\">'5.99'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Utility'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Care product'<\/span>,\n      quantity: <span style=\"color:#a50\">'1'<\/span>\n    }]\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p><strong>Required<\/strong> parameter is just <code>shipping_tier<\/code>.<\/p>\n<p>You can also add promotion and item list parameters (e.g. <code>promotion_name<\/code> or <code>item_list_name<\/code>) to the items in the <code>items<\/code> array if you want to add credit to a promotion or an item list for the current action.<\/p>\n<h4 id=\"migration-from-enhanced-ecommerce-8\">Migration from Enhanced Ecommerce<\/h4>\n<p>You can migrate from Enhanced Ecommerce by grabbing the shipping method from the <code>ecommerce.checkout.option<\/code> or <code>ecommerce.checkout_option.option<\/code> Data Layer variables, depending on how you\u2019ve setup shipping method selection.<\/p>\n<p>You\u2019ll need to make sure that the trigger that fires this GA4 tag corresponds with the correct <code>option<\/code> item pushed into <code>dataLayer<\/code>, so that you don\u2019t inadvertently fire this tag when the payment method was selected, for example.<\/p>\n<p>If you want to send the <code>items<\/code> array as well (recommended), you can use a Data Layer variable like this:<\/p>\n<ul>\n<li><strong>Type<\/strong>: Data Layer Variable<\/li>\n<li><strong>Data Layer Variable name<\/strong>: <code>ecommerce.checkout.products<\/code><\/li>\n<li><strong>Data Layer Version<\/strong>: Version 2<\/li>\n<\/ul>\n<h4 id=\"tag-configuration-10\">Tag configuration<\/h4>\n<p>The tag for <code>add_shipping_info<\/code> would look like this:<\/p>\n<div style=\"aspect-ratio: 1800 \/ 1256;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/add-shipping-info-tag.jpg\" title=\"add_shipping_info tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1256\" width=\"1800\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/add-shipping-info-tag.jpg#ZgotmplZ\" alt=\"add_shipping_info tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Make sure you set the <strong>Event Name<\/strong> field to <code>add_shipping_info<\/code>.<\/p>\n<p>Make sure you point the <code>items<\/code> parameter to a Data Layer variable that contains the <code>items<\/code> array. This would be:<\/p>\n<ul>\n<li><code>ecommerce.items<\/code> if you\u2019re following the steps outlined <a href=\"#data-layer-composition-10\">here<\/a>.<\/li>\n<li><code>ecommerce.checkout.products<\/code> if you\u2019ve chosen to <a href=\"#migration-from-enhanced-ecommerce-10\">migrate<\/a> from Enhanced Ecommerce.<\/li>\n<\/ul>\n<p>Make sure you point the <code>shipping_tier<\/code> parameter to a Data Layer variable that contains the <code>shipping_tier<\/code> value. This would be:<\/p>\n<ul>\n<li><code>ecommerce.shipping_tier<\/code> if you\u2019re following the steps outlined <a href=\"#data-layer-composition-10\">here<\/a>.<\/li>\n<li><code>ecommerce.checkout.option<\/code> or <code>ecommerce.checkout_option.option<\/code> if you\u2019ve chosen to <a href=\"#migration-from-enhanced-ecommerce-10\">migrate<\/a> from Enhanced Ecommerce.<\/li>\n<\/ul>\n<p>Remember also to set <strong>the trigger<\/strong> to a Custom Event trigger, set to the value of the <code>event<\/code> key in the object that was pushed to <code>dataLayer<\/code> (in the example <a href=\"#data-layer-composition-10\">above<\/a>, it would be <code>add_shipping_info<\/code>). If you\u2019re migrating from Enhanced Ecommerce, make sure the trigger fires when the <strong>shipping method<\/strong> has been selected, and not for any other checkout option you might have.<\/p>\n<blockquote>\n<p>You can add additional parameters (in addition to <code>items<\/code>) such as <code>promotion_name<\/code> or <code>item_list_name<\/code> if you want to associate this event with a promotion or an item list, respectively.<\/p>\n<\/blockquote>\n<h3 id=\"add_payment_info\">add_payment_info<\/h3>\n<p>The <code>add_payment_info<\/code> event is sent when the user has selected a payment method.<\/p>\n<blockquote>\n<p>While Enhanced Ecommerce doesn\u2019t have a direct analogy to <code>add_payment_info<\/code>, most implementations have payment method selection encoded in a <code>checkout_option<\/code> object.<\/p>\n<\/blockquote>\n<h4 id=\"data-layer-composition-11\">Data Layer composition<\/h4>\n<p>A sample <code>dataLayer<\/code> object for the <code>add_payment_info<\/code> event could 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\">'add_payment_info'<\/span>,\n  ecommerce: {\n    payment_type: <span style=\"color:#a50\">'COD'<\/span>,\n    items: [{\n      item_name: <span style=\"color:#a50\">'Finnish magical parka'<\/span>,\n      item_id: <span style=\"color:#a50\">'mp1122'<\/span>,\n      price: <span style=\"color:#a50\">'31.10'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Coats'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Parkas'<\/span>,\n      item_category4: <span style=\"color:#a50\">'Unisex'<\/span>,\n      item_variant: <span style=\"color:#a50\">'Navy blue'<\/span>,\n      quantity: <span style=\"color:#a50\">'3'<\/span>\n    },{\n      item_name: <span style=\"color:#a50\">'Parka stain removal'<\/span>,\n      item_id: <span style=\"color:#a50\">'psr1332'<\/span>,\n      price: <span style=\"color:#a50\">'5.99'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Utility'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Care product'<\/span>,\n      quantity: <span style=\"color:#a50\">'1'<\/span>\n    }]\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p><strong>Required<\/strong> parameter is just <code>payment_type<\/code>.<\/p>\n<p>You can also add promotion and item list parameters (e.g. <code>promotion_name<\/code> or <code>item_list_name<\/code>) to the items in the <code>items<\/code> array if you want to add credit to a promotion or an item list for the current action.<\/p>\n<h4 id=\"migration-from-enhanced-ecommerce-9\">Migration from Enhanced Ecommerce<\/h4>\n<p>You can migrate from Enhanced Ecommerce by grabbing the payment method from the <code>ecommerce.checkout.option<\/code> or <code>ecommerce.checkout_option.option<\/code> Data Layer variables, depending on how you\u2019ve setup payment method selection.<\/p>\n<p>You\u2019ll need to make sure that the trigger that fires this GA4 tag corresponds with the correct <code>option<\/code> item pushed into <code>dataLayer<\/code>, so that you don\u2019t inadvertently fire this tag when the shipping method was selected, for example.<\/p>\n<p>If you want to send the <code>items<\/code> array as well (recommended), you can use a Data Layer variable like this:<\/p>\n<ul>\n<li><strong>Type<\/strong>: Data Layer Variable<\/li>\n<li><strong>Data Layer Variable name<\/strong>: <code>ecommerce.checkout.products<\/code><\/li>\n<li><strong>Data Layer Version<\/strong>: Version 2<\/li>\n<\/ul>\n<h4 id=\"tag-configuration-11\">Tag configuration<\/h4>\n<p>The tag for <code>add_payment_info<\/code> would look like this:<\/p>\n<div style=\"aspect-ratio: 1800 \/ 1268;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/add-payment-info.jpg\" title=\"add_payment_info tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1268\" width=\"1800\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/add-payment-info.jpg#ZgotmplZ\" alt=\"add_payment_info tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Make sure you set the <strong>Event Name<\/strong> field to <code>add_payment_info<\/code>.<\/p>\n<p>Make sure you point the <code>items<\/code> parameter to a Data Layer variable that contains the <code>items<\/code> array. This would be:<\/p>\n<ul>\n<li><code>ecommerce.items<\/code> if you\u2019re following the steps outlined <a href=\"#data-layer-composition-11\">here<\/a>.<\/li>\n<li><code>ecommerce.checkout.products<\/code> if you\u2019ve chosen to <a href=\"#migration-from-enhanced-ecommerce-11\">migrate<\/a> from Enhanced Ecommerce.<\/li>\n<\/ul>\n<p>Make sure you point the <code>payment_type<\/code> parameter to a Data Layer variable that contains the <code>payment_tpye<\/code> value. This would be:<\/p>\n<ul>\n<li><code>ecommerce.payment_type<\/code> if you\u2019re following the steps outlined <a href=\"#data-layer-composition-11\">here<\/a>.<\/li>\n<li><code>ecommerce.checkout.option<\/code> or <code>ecommerce.checkout_option.option<\/code> if you\u2019ve chosen to <a href=\"#migration-from-enhanced-ecommerce-11\">migrate<\/a> from Enhanced Ecommerce.<\/li>\n<\/ul>\n<p>Remember also to set <strong>the trigger<\/strong> to a Custom Event trigger, set to the value of the <code>event<\/code> key in the object that was pushed to <code>dataLayer<\/code> (in the example <a href=\"#data-layer-composition-11\">above<\/a>, it would be <code>add_payment_info<\/code>). If you\u2019re migrating from Enhanced Ecommerce, make sure the trigger fires when the <strong>payment method<\/strong> has been selected, and not for any other checkout option you might have.<\/p>\n<blockquote>\n<p>You can add additional parameters (in addition to <code>items<\/code>) such as <code>promotion_name<\/code> or <code>item_list_name<\/code> if you want to associate this event with a promotion or an item list, respectively.<\/p>\n<\/blockquote>\n<h3 id=\"purchase\">purchase<\/h3>\n<p>The <code>purchase<\/code> event is sent when the user makes a purchase on the site.<\/p>\n<blockquote>\n<p>Make sure you configure your website so that the purchase data is <strong>only collected once<\/strong>. The best way to do this is to invalidate the thank you page once the user has visited it so that they can\u2019t revisit it by reloading the page, using the browser history, or hitting the back button after moving to some other page. <strong>Duplicate transactions<\/strong> are things you need to avoid at all costs.<\/p>\n<\/blockquote>\n<h4 id=\"data-layer-composition-12\">Data Layer composition<\/h4>\n<p>A sample <code>dataLayer<\/code> object for the <code>purchase<\/code> event could 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\">'purchase'<\/span>,\n  ecommerce: {\n    currency: <span style=\"color:#a50\">'EUR'<\/span>,\n    value: <span style=\"color:#099\">116.47<\/span>,\n    tax: <span style=\"color:#099\">7.18<\/span>,\n    shipping: <span style=\"color:#099\">10.00<\/span>,\n    affiliation: <span style=\"color:#a50\">'My Parka Store'<\/span>,\n    transaction_id: <span style=\"color:#a50\">'p115-20202000'<\/span>,\n    coupon: <span style=\"color:#a50\">'free_back_rub'<\/span>,\n    items: [{\n      item_name: <span style=\"color:#a50\">'Finnish magical parka'<\/span>,\n      item_id: <span style=\"color:#a50\">'mp1122'<\/span>,\n      price: <span style=\"color:#a50\">'31.10'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Coats'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Parkas'<\/span>,\n      item_category4: <span style=\"color:#a50\">'Unisex'<\/span>,\n      item_variant: <span style=\"color:#a50\">'Navy blue'<\/span>,\n      quantity: <span style=\"color:#a50\">'3'<\/span>\n    },{\n      item_name: <span style=\"color:#a50\">'Parka stain removal'<\/span>,\n      item_id: <span style=\"color:#a50\">'psr1332'<\/span>,\n      price: <span style=\"color:#a50\">'5.99'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Utility'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Care product'<\/span>,\n      quantity: <span style=\"color:#a50\">'1'<\/span>,\n      item_coupon: <span style=\"color:#a50\">'cheap_stain_removal'<\/span>\n    }]\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p><strong>Required<\/strong> parameters are <code>transaction_id<\/code> and <code>currency<\/code>.<\/p>\n<blockquote>\n<p>Make sure <code>quantity<\/code> is passed as an integer. A floating point value will cause <strong>item revenue<\/strong> to be incorrectly reported in the Monetization reports!<\/p>\n<\/blockquote>\n<p>You can also add promotion and item list parameters (e.g. <code>promotion_name<\/code> or <code>item_list_name<\/code>) to the items in the <code>items<\/code> array if you want to add credit to a promotion or an item list for the current action.<\/p>\n<h4 id=\"migration-from-enhanced-ecommerce-10\">Migration from Enhanced Ecommerce<\/h4>\n<p>You can grab all the required parameters from the Enhanced Ecommerce <code>purchase<\/code> event. You need to create <strong>Data Layer Variables<\/strong> (Version 2) for each. Here are the <strong>Data Layer Variable Names<\/strong> you need to configure in the variables:<\/p>\n<table>\n<thead>\n<tr>\n<th>GA4 parameter<\/th>\n<th>Data Layer Variable Name in EEC<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>currency<\/code><\/td>\n<td><code>ecommerce.currencyCode<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>value<\/code><\/td>\n<td><code>ecommerce.purchase.actionField.revenue<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>tax<\/code><\/td>\n<td><code>ecommerce.purchase.actionField.tax<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>shipping<\/code><\/td>\n<td><code>ecommerce.purchase.actionField.shipping<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>affiliation<\/code><\/td>\n<td><code>ecommerce.purchase.actionField.affiliation<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>transaction_id<\/code><\/td>\n<td><code>ecommerce.purchase.actionField.id<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>coupon<\/code><\/td>\n<td><code>ecommerce.purchase.actionField.coupon<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>items<\/code><\/td>\n<td><code>ecommerce.purchase.products<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p>You can also use my <a href=\"https:\/\/www.simoahava.com\/custom-templates\/eec-products-ga4-items\/\">custom variable template<\/a> to convert an Enhanced Ecommerce <code>products<\/code> object automatically to the format required by <code>purchase<\/code>.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-12\">Tag configuration<\/h4>\n<p>The tag for <code>purchase<\/code> would look like this:<\/p>\n<div style=\"aspect-ratio: 1806 \/ 1556;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/purchase-tag.jpg\" title=\"purchase tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1556\" width=\"1806\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/purchase-tag.jpg#ZgotmplZ\" alt=\"purchase tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Make sure you set the <strong>Event Name<\/strong> field to <code>purchase<\/code>.<\/p>\n<p>Make sure you point the <code>items<\/code> parameter to a Data Layer variable that contains the <code>items<\/code> array. This would be:<\/p>\n<ul>\n<li><code>ecommerce.items<\/code> if you\u2019re following the steps outlined <a href=\"#data-layer-composition-12\">here<\/a>.<\/li>\n<li><code>ecommerce.purchase.products<\/code> if you\u2019ve chosen to <a href=\"#migration-from-enhanced-ecommerce-12\">migrate<\/a> from Enhanced Ecommerce.<\/li>\n<\/ul>\n<p>Make sure you point all the other parameters to their counterparts in the <code>ecommerce<\/code> array. If you\u2019re migrating from Enhanced Ecommerce you\u2019d need to set them <a href=\"#migration-from-enhanced-ecommerce-12\">accordingly<\/a>.<\/p>\n<p>Remember also to set <strong>the trigger<\/strong> to a Custom Event trigger, set to the value of the <code>event<\/code> key in the object that was pushed to <code>dataLayer<\/code> (in the example <a href=\"#data-layer-composition-12\">above<\/a>, it would be <code>purchase<\/code>).<\/p>\n<blockquote>\n<p>You can add additional parameters (in addition to <code>items<\/code>) such as <code>promotion_name<\/code> or <code>item_list_name<\/code> if you want to associate this event with a promotion or an item list, respectively.<\/p>\n<\/blockquote>\n<h3 id=\"refund\">refund<\/h3>\n<p>There are two types of <code>refund<\/code> events you can send: <strong>full refund<\/strong> (the entire transaction is refunded) and <strong>partial refund<\/strong> (only some items were refunded).<\/p>\n<h4 id=\"data-layer-composition-13\">Data Layer composition<\/h4>\n<p>For a <strong>full refund<\/strong>, this is what a sample <code>dataLayer<\/code> object 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\">'refund'<\/span>,\n  ecommerce: {\n    transaction_id: <span style=\"color:#a50\">'p115-20202000'<\/span>\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p><strong>Required<\/strong> parameter is <code>transaction_id<\/code>.<\/p>\n<p>For a <strong>partial refund<\/strong>, this is what a sample <code>dataLayer<\/code> object 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\">'refund'<\/span>,\n  ecommerce: {\n    transaction_id: <span style=\"color:#a50\">'p115-20202000'<\/span>,\n    items: [{\n      item_name: <span style=\"color:#a50\">'Finnish magical parka'<\/span>,\n      item_id: <span style=\"color:#a50\">'mp1122'<\/span>,\n      price: <span style=\"color:#a50\">'31.10'<\/span>,\n      item_brand: <span style=\"color:#a50\">'PARKA4LIFE'<\/span>,\n      item_category: <span style=\"color:#a50\">'Apparel'<\/span>,\n      item_category2: <span style=\"color:#a50\">'Coats'<\/span>,\n      item_category3: <span style=\"color:#a50\">'Parkas'<\/span>,\n      item_category4: <span style=\"color:#a50\">'Unisex'<\/span>,\n      item_variant: <span style=\"color:#a50\">'Navy blue'<\/span>,\n      quantity: <span style=\"color:#a50\">'1'<\/span>\n    }]\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p><strong>Required<\/strong> parameters are <code>transaction_id<\/code>, and for each item that is refunded, <code>item_id<\/code> and <code>quantity<\/code> refunded.<\/p>\n<h4 id=\"migration-from-enhanced-ecommerce-11\">Migration from Enhanced Ecommerce<\/h4>\n<p>To migrate from an Enhanced Ecommerce setup, you\u2019d need to create a Data Layer variable for the transaction ID and another one for the products that were refunded.<\/p>\n<p>The Data Layer variable for <strong>transaction ID<\/strong> looks like this:<\/p>\n<ul>\n<li><strong>Type<\/strong>: Data Layer Variable<\/li>\n<li><strong>Data Layer Variable name<\/strong>: <code>ecommerce.refund.actionField.id<\/code><\/li>\n<li><strong>Data Layer Version<\/strong>: Version 2<\/li>\n<\/ul>\n<p>The Data Layer variable for the refunded <strong>products<\/strong> looks like this:<\/p>\n<ul>\n<li><strong>Type<\/strong>: Data Layer Variable<\/li>\n<li><strong>Data Layer Variable name<\/strong>: <code>ecommerce.refund.products<\/code><\/li>\n<li><strong>Data Layer Version<\/strong>: Version 2<\/li>\n<\/ul>\n<blockquote>\n<p>You can also use my <a href=\"https:\/\/www.simoahava.com\/custom-templates\/eec-products-ga4-items\/\">custom variable template<\/a> to convert an Enhanced Ecommerce <code>products<\/code> object automatically to the format required by <code>refund<\/code>.<\/p>\n<\/blockquote>\n<h4 id=\"tag-configuration-13\">Tag configuration<\/h4>\n<p>The tag for <code>refund<\/code> would look like this:<\/p>\n<div style=\"aspect-ratio: 1796 \/ 1266;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/10\/refund-tag.jpg\" title=\"refund tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1266\" width=\"1796\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/10\/refund-tag.jpg#ZgotmplZ\" alt=\"refund tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Make sure you set the <strong>Event Name<\/strong> field to <code>refund<\/code>.<\/p>\n<p>If you\u2019re sending a <strong>full<\/strong> refund, you only need to configure the <code>transaction_id<\/code> field. It should point to either <code>ecommerce.transaction_id<\/code> or, if you\u2019re <a href=\"#migration-from-enhanced-ecommerce-13\">migrating from Enhanced Ecommerce<\/a>, to <code>ecommerce.refund.actionField.id<\/code>.<\/p>\n<p>If you\u2019re sending a <strong>partial<\/strong> refund, you\u2019ll also need to configure the <code>items<\/code> field to point to either the <code>ecommerce.items<\/code> variable or the <code>ecommerce.refund.products<\/code> variable, with the latter used in case you\u2019re migrating from Enhanced Ecommerce.<\/p>\n<p>Remember also to set <strong>the trigger<\/strong> to a Custom Event trigger, set to the value of the <code>event<\/code> key in the object that was pushed to <code>dataLayer<\/code> (in the example <a href=\"#data-layer-composition-12\">above<\/a>, it would be <code>refund<\/code>).<\/p>\n<h2 id=\"summary\">Summary<\/h2>\n<p>We all knew that Google Analytics 4 properties would include Ecommerce capabilities. I think we were all surprised by how <em>beta<\/em> they still were by the time GA4 was released <em>out of beta<\/em>.<\/p>\n<p>It doesn\u2019t really help that the Google Tag Manager tags are still lagging behind in development. There\u2019s a <strong>lot<\/strong> of manual work involved in building an Ecommerce setup, and while we\u2019ve been treated with a migration option from Universal Analytics\u2019 Enhanced Ecommerce, it doesn\u2019t necessarily make sense to use.<\/p>\n<p>The new, <strong>gtag.js<\/strong>-based format is where all the cool new stuff will be introduced. If you choose complacency over the effort of properly moving to the new setup, you might end up with a suboptimal Ecommerce setup for future iterations of GA4\u2019s Ecommerce reports.<\/p>\n<p>Having said that, it makes sense to <strong>implement<\/strong> GA4 Ecommerce as soon as possible. You don\u2019t have to abandon your Universal Analytics setup, but do proceed with either a migration or a completely new <code>dataLayer<\/code> setup for GA4 as well.<\/p>\n<p>You\u2019ll want to start collecting that GA4 data as soon as possible to prepare for the eventual shift from Universal Analytics to Google Analytics 4. At that point, the more historical data you have, the better you\u2019ll know how the new paradigm works for your organization.<\/p>\n<p>I know absolute use case parity with Enhanced Ecommerce isn\u2019t something GA4 Ecommerce should even pursue, but we\u2019re still missing things like <strong>easily managed item list and promotion attribution<\/strong> from the mix.<\/p>\n<p>The Google Tag Manager tags are also missing a few key pieces, such as an option to pull in all Ecommerce data directly from the <code>dataLayer<\/code> or even from a Custom JavaScript variable (or custom template).<\/p>\n<p>Until we have these things, it\u2019s best to treat GA4 Ecommerce as being in <strong>rough beta<\/strong>, even if that label has officially been dropped.<\/p>\n<p>What are you most looking forward to about the GA4\u2019s Ecommerce reports? What do you expect the Google Tag Manager integration to look like?<\/p>\n<\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Last updated 17 March 2023: Item-scoped Custom Dimensions are now available in Google Analytics 4. This is an implementation guide for Google Analytics 4. The guide is aimed at Google Tag Manager users and has been designed to complement the official documentation. A thing to keep in mind is that Google Analytics 4 (GA4) is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":79061,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[12765,11161,1531,2059,14495,1791],"dealstore":[],"offerexpiration":[],"class_list":["post-79060","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-analytics","tag-ecommerce","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>Google Analytics 4: 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=79060\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Google Analytics 4: Ecommerce Guide For Google Tag Manager - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"Last updated 17 March 2023: Item-scoped Custom Dimensions are now available in Google Analytics 4. This is an implementation guide for Google Analytics 4. The guide is aimed at Google Tag Manager users and has been designed to complement the official documentation. A thing to keep in mind is that Google Analytics 4 (GA4) is [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=79060\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-10T03:22:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/app-web-ecommerce.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1796\" \/>\n\t<meta property=\"og:image:height\" content=\"922\" \/>\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=\"43 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=79060#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=79060\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"Google Analytics 4: Ecommerce Guide For Google Tag Manager\",\"datePublished\":\"2025-02-10T03:22:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=79060\"},\"wordCount\":6840,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=79060#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/app-web-ecommerce.jpg\",\"keywords\":[\"Analytics\",\"ECommerce\",\"Google\",\"Guide\",\"Manager\",\"TAG\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=79060#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=79060\",\"url\":\"https:\/\/fivemor.com\/?p=79060\",\"name\":\"Google Analytics 4: Ecommerce Guide For Google Tag Manager - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=79060#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=79060#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/app-web-ecommerce.jpg\",\"datePublished\":\"2025-02-10T03:22:49+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=79060#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=79060\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=79060#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/app-web-ecommerce.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/app-web-ecommerce.jpg\",\"width\":1796,\"height\":922},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=79060#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Google Analytics 4: 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":"Google Analytics 4: 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=79060","og_locale":"en_US","og_type":"article","og_title":"Google Analytics 4: Ecommerce Guide For Google Tag Manager - Som2ny Network","og_description":"Last updated 17 March 2023: Item-scoped Custom Dimensions are now available in Google Analytics 4. This is an implementation guide for Google Analytics 4. The guide is aimed at Google Tag Manager users and has been designed to complement the official documentation. A thing to keep in mind is that Google Analytics 4 (GA4) is [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=79060","og_site_name":"Som2ny Network","article_published_time":"2025-02-10T03:22:49+00:00","og_image":[{"width":1796,"height":922,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/app-web-ecommerce.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"43 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=79060#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=79060"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"Google Analytics 4: Ecommerce Guide For Google Tag Manager","datePublished":"2025-02-10T03:22:49+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=79060"},"wordCount":6840,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=79060#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/app-web-ecommerce.jpg","keywords":["Analytics","ECommerce","Google","Guide","Manager","TAG"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=79060#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=79060","url":"https:\/\/fivemor.com\/?p=79060","name":"Google Analytics 4: Ecommerce Guide For Google Tag Manager - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=79060#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=79060#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/app-web-ecommerce.jpg","datePublished":"2025-02-10T03:22:49+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=79060#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=79060"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=79060#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/app-web-ecommerce.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/app-web-ecommerce.jpg","width":1796,"height":922},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=79060#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"Google Analytics 4: 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\/79060","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=79060"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/79060\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/79061"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=79060"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=79060"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=79060"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=79060"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=79060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}