Title: Basic eCommerce dataLayer setup
Last modified: July 25, 2019

---

# Basic eCommerce dataLayer setup

 *  [danescobar](https://wordpress.org/support/users/danescobar/)
 * (@danescobar)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/basic-ecommerce-datalayer-setup/)
 * Hello Thomas, thanks for the work you’re doing with your plugin, it saves a lot
   of work.
 * I installed your plugin because of its work on the dataLayer. I previously had
   GTM installed through a PHP function but, as the more I’ve been learning about
   GTM, the more I’ve seen implementing a dataLayer for EEC would take a lot of 
   work.
 * My questions are:
 * **1.-** Does your plugin just populate the dataLayer and the user has to configure
   all the variables manually in GTM? I mean check the keys, when they load, etc.
   and then add the variable, configure the trigger and tag for each ecommerce event
   the user wants to track?
    **2.-** Does your plugin do a basic tracking by itself
   and reflects it in GA like other plugins do, for example, [WooCommerce Google Analytics Integration](https://wordpress.org/support/plugin/woocommerce-google-analytics-integration/)?**
   3.-** If I have to configure everything manually is there a basic guide I can
   follow of someone who has already done the basic work for the most common tags?
   To save users the work of checking with Tag Assistant every key, when it populates,
   thinking how to configure the variable, trigger and tag, etc.
 * I don’t want to do anything fancy just basic tracking of add to carts and purchases
   like what I had in GA before adding GTM. The guide could save a lot of time to
   many users who can implement the most basic tags with the same configuration.
 * Thank you for your time.

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/basic-ecommerce-datalayer-setup/#post-11769729)
 * Hi,
 * 1. yes, the plugin only created the necessary data layer values and plugin users
   need to setup GTM based on this quide:
    [https://gtm4wp.com/how-to-articles/how-to-setup-enhanced-ecommerce-tracking](https://gtm4wp.com/how-to-articles/how-to-setup-enhanced-ecommerce-tracking)
 * 2. define “basic” 🙂
    This plugin has an almost complete enhanced ecommerce implementation.“
   Almost” means that for example tracking internal promotions is not part of the
   code currently as WooCommerce does not have a standard UI for this and since 
   there are some many different 3rd party solutions for internal banner usage I
   am not able to provide a standard way to track this.
 * The plugin will not send any data to GA directly, you need to setup tags within
   your GTM container.
 * 3. see the link in #1 🙂
 *  Thread Starter [danescobar](https://wordpress.org/support/users/danescobar/)
 * (@danescobar)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/basic-ecommerce-datalayer-setup/#post-11775657)
 * Thanks for the guide [@duracelltomi](https://wordpress.org/support/users/duracelltomi/)
   just what I needed but now I’m a bit confused…
 * Once I’ve setup the guide’s helper tag, how can I create individual tags using
   the “eCommerce helper” events with custom actions and labels for each one?
 * If I leave it as is, in GA will only appear events with “eCommerce helper” category
   and the name of the dataLayer variable as action.
 * What I did before reading your guide was to make different tags for some of your
   most important dataLayer variables with its own action and label based on each
   variable for better readability and comprehension.
 * So, how do I proceed now creating new tags that use your “eCommerce helper” data?
 * In addition, can I setup an event like “RemoveFromCart” tag manager label like
   this?:
    Label field:`Name:{{DLV ProductName}},Quantity:{{DLV ProductQuantity}},
   Variation:{{DLV ProductVariation}}` if I setup the dataLayer variable name of
   DLV ProductName and the others like: `ecommerce.remove.products.0.name` So in
   the GA report appears a Label like: `Name:T-Shirt,Quantity:2,Variation:Blue`
 * Thanks for your time.
    -  This reply was modified 6 years, 10 months ago by [danescobar](https://wordpress.org/support/users/danescobar/).
      Reason: adding a new question
 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/basic-ecommerce-datalayer-setup/#post-11780663)
 * Hi,
 * Why do you want to add product data in your event reports if the data is present
   in your ecommerce reports? 🙂
 * Generally you can create separate triggers for every ecommerce action with just
   one event name instead of listing all available events in one event trigger. 
   Then you can create your separate tags.
 *  [thisdayandage](https://wordpress.org/support/users/thisdayandage/)
 * (@thisdayandage)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/basic-ecommerce-datalayer-setup/#post-11781363)
 * Hi,
 * Apologies if this is repeating the initial question, but I am about to activate
   your plugin for the first time (for using standard e-commerce) and just want 
   to check a couple of things first:
 * 1. I will need to remove both the UA and GTM script already inserted in the header
   section to allow the plugin to insert them (or do I just remove the GTM code)?
   Should I remove the iframe GTM snippet also or does the plugin not add this to
   capture users blocking javascript?
 * 2. The plugin will create the necessary data layer variables and insert above
   the GTM script so that all that is required from my end is to create the tag 
   in GTM and set to trigger with the custom event of the transaction (e.g. “gtm4wp.
   orderCompleted”)
 * Many thanks for your help and in advance for the plugin!
 * Matthew
 *  Thread Starter [danescobar](https://wordpress.org/support/users/danescobar/)
 * (@danescobar)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/basic-ecommerce-datalayer-setup/#post-11782049)
 * [@duracelltomi](https://wordpress.org/support/users/duracelltomi/) wrote:
 * > Why do you want to add product data in your event reports if the data is present
   > in your ecommerce reports?
 * Hi, for several reasons:
    - Because I’m new at learning GA and GTM implementation and I really don’t know
      how the helper tag will pass data to GA eCommerce report, please from now 
      on, if I make an erroneous assumption or mistake correct me. For example, 
      in “eCommerce>Product Performance” there’s no data yet after publishing your
      helper tag in GTM. This led me to believe there’s an additional step in the
      configuration of GTM. Strangely enough there’s data in “eCommerce>Product 
      List Performance”, a list of my related and upsell products but no product
      list in “Product Performance”.
    - Because, in your guide, there’s the next paragraph:
    - > Note: this tag is going to be a ‘messenger’. The goal of this tag is not
      > to populate Event reports with useful data but to pass additional enhanced
      > ecommerce product data next to your event settings while users interact 
      > with your shop.
    -  That, again, led me to believe there’s additional configuration step in GTM(“
      _populate Event reports with useful data_“) to make everything work as intended
      in GA.
    - Your helper tag will pass the EEC events to GA so I imagine that in “Behavior
      >Top Events” all eCommerce events will trigger with an action field like: `
      gtm4wp.AddProductToCartEEC` If I can setup separate tags with dataLayer variables
      so this event displays like `Action: "Click AddToCart" Label: "Name:T-Shirt,
      Quantity:1, Variation:Blue,XL"` it won’t be that much more work, it will pass
      data a bit more readable and with more data. Yesterday while waiting for your
      answer, aside configuring your helper tag, I’ve setup separate tags for:
 *  1. EEC Checkout Initiated -> gtm4wp.checkoutOptionEEC
    2. EEC Click AddToCart -> gtm4wp.AddToCartEEC
    3. EEC Click RemoveFromCart -> gtm4wp.RemoveFromCartEEC
    4. EEC Click Product -> gtm4wp.productClickEEC
    5. EEC Purchase -> gtm4wp.orderCompleted (Tracking Type: Transaction)
 * I know it can duplicate events and eCommerce data but, in the meantime, I wanted
   to test if the tags will display data as I imagined. By the way, why your helper
   tag does not need the `gtm4wp.orderCompleted` event? Is `gtm4wp.checkoutOptionEEC`
   its equivalent for Enhanced eCommerce?
 * It’s hard to learn GTM and GA correctly, there are many guides online for configuring
   separate steps but few join the puzzle pieces together so novices have a correct
   view of the whole picture and how it will look in the GA reports. Reading other
   guides apart from yours on GTM and GA I have the sensation that many skip the
   most technical steps hiding the fact that the writer doesn’t even know how to
   configure things correctly, giving the impression as if they limited only to 
   do a copy-paste from other websites. It doesn’t help either that Google’s own
   guides aren’t very good at explaining their own tools.
 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/basic-ecommerce-datalayer-setup/#post-11784250)
 * Hi,
 * Thanks for the detailed answer.
 * > I really don’t know how the helper tag will pass data to GA eCommerce report
 * This is like “behind the scenes”.
    Google Analytics sends data from your website
   to its servers using data packages called the “hits”. Each hit includes lots 
   of data about what happened on your site. There are several types of hits but
   the most commonly known hit types are the pageview hit and the event hit. Unfortunately
   there is no such hit type like “ecommerce” hit, if the user on your site does
   any ecommerce action, we need to pack this into a pageview hit or an event hit.
 * The pageview hit is quite easy to understand: for example on your product detail
   page, while the page loads and your main GA tag fires, it will also include the
   attributes of the product currently being shown.
 * For ecommerce interactions between two pageviews, we need to use something that
   initiates a hit send. This is where event tracking comes in. An event hit can
   happen between two pageviews, sure, it has its parameters (like the category,
   action, label and value) but for us, this is not the important part. Important
   is, that we can use this event hit to add additional data sent to GA. This additional
   data will be the ecommerce action (“add”) and the product attributes. It is indifferent
   how you name the event parameters since the event hit will be only used to have
   something that sends data from your website to Google’s servers. This is why 
   I call this the “messenger tag”. It is used to incorporate ecommerce data next
   to the event data and this is what matters, not the event parameters.
 * Does this make things more clear?
 *  Thread Starter [danescobar](https://wordpress.org/support/users/danescobar/)
 * (@danescobar)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/basic-ecommerce-datalayer-setup/#post-11785394)
 * Yes, it clear things a bit more, thanks [@duracelltomi](https://wordpress.org/support/users/duracelltomi/).
   But in my answer I made two questions you haven’t answered yet:
 * > Why your helper tag does not need the `gtm4wp.orderCompleted` event? Do I still
   > need to configure it in GTM or is `gtm4wp.checkoutOptionEEC` its equivalent
   > for Enhanced eCommerce?
 * > I configured your “**messenger tag**” in GTM with the help of your guide. But
   > despite this, in my GA “**eCommerce>Product Performance**” section there’s 
   > no data yet. But there’s data in “**eCommerce>Product List Performance**”, 
   > a list of my related and upsell products. When I had GA and not GTM there was
   > a list of my products even though there were no eCommerce events. The list 
   > was just my products with a performance of $0. Now there’s no list of product
   > names. Is this normal?
 * Here a [post with images](https://imgur.com/a/PGu9knv) to illustrate my question
   better.
 * By what I can understand from your answer I’m on the right track setting up separate
   tags and triggers for each of your plugin’s events and then deleting the original“
   messenger tag”. Am I correct?
 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/basic-ecommerce-datalayer-setup/#post-11791888)
 * Sorry for missing those two questions.
 * gtm4wp.orderCompleted: this is an obsolete event, it was important back when 
   many WordPress users had to put GTM related codes in the footer of the page. 
   It will be removed in a future version of the plugin
 * gtm4wp.checkoutOptionEEC is different, it tracks when a users selects a shipping
   method or a payment method. It helps you to segment your checkout behavior report
   based on the selected shipping or payment option.
 * eCommerce>Product Performance should show you data once you have tracked orders
   in your eCommerce->Sales Performance report. Do you have some?
 * eCommerce>Product List Performance should also include a list named “General 
   product list” – don’t you see any such product list in this report?
 * If you would like to have separate tags for each event GTM4WP provides, you can
   of course setup different triggers and tags for that, but this will not change
   the accuracy of your ecommerce report in Google Analytics.
 *  Thread Starter [danescobar](https://wordpress.org/support/users/danescobar/)
 * (@danescobar)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/basic-ecommerce-datalayer-setup/#post-11796058)
 * > gtm4wp.orderCompleted: this is an obsolete event
 * Ok, I deleted a tag that used this event “Purchase Completed”.
 * > eCommerce>Product List Performance should also include a list named “General
   > product list” – don’t you see any such product list in this report
 * I don’t have this list anymore since I made the change to GTM and your plugin
   setting your messenger/helper tag. Before I had this list; when I had a plugin
   by Woocommerce that integrated their store with GA.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Basic eCommerce dataLayer setup’ is closed to new replies.

 * ![](https://ps.w.org/duracelltomi-google-tag-manager/assets/icon-256x256.png?
   rev=1708451)
 * [GTM4WP - A Google Tag Manager (GTM) plugin for WordPress](https://wordpress.org/plugins/duracelltomi-google-tag-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/duracelltomi-google-tag-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/reviews/)

 * 9 replies
 * 3 participants
 * Last reply from: [danescobar](https://wordpress.org/support/users/danescobar/)
 * Last activity: [6 years, 10 months ago](https://wordpress.org/support/topic/basic-ecommerce-datalayer-setup/#post-11796058)
 * Status: not a support question