Title: Variables for E-Commerce Pixels
Last modified: August 30, 2016

---

# Variables for E-Commerce Pixels

 *  [Sonic55](https://wordpress.org/support/users/sonic55/)
 * (@sonic55)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/variables-for-e-commerce-pixels/)
 * Hi Thomas,
 * thanks for this great plugin and also your fast support I see you give on other
   threads. I hope you can help me as well.
 * The datalayer is something quite complex, especially for not so tech-savvy people
   as I am 🙂 I managed to set up your plugin, also the enhanced GA tracking and
   so forth but struggling with one issue. And I a not sure whether I just missed
   something or totally misunderstood the whole GTM.
 * I want to integrate a tag from a 3rd party, lets say its a retargeting company.
   They require to pass them the following variables in the tag on the thankyou 
   page:
    – Total Revenue – Currency – Transaction ID – Number of products purchased–
   Price of each product and so on
 * My question: I stumbled upon “total revenue” before in the Google Adwords Tag
   and I know that this is the variable “transactionTotal”. But what about the others?
   Are those also transmitted through the datalayer of your plugin (I use woocommerce)?
   Or do i need to setup those myself? Is there some kind of list with all existing
   variables?
 * I hope you understand the problem I have with the layer & variables.
    My site
   is: [http://www.greenyogashop.com](http://www.greenyogashop.com)
 * Thanks and all the best
    Sonic
 * [https://wordpress.org/plugins/duracelltomi-google-tag-manager/](https://wordpress.org/plugins/duracelltomi-google-tag-manager/)

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

 *  Thread Starter [Sonic55](https://wordpress.org/support/users/sonic55/)
 * (@sonic55)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/variables-for-e-commerce-pixels/#post-6694841)
 * Hi Thomas (or anyone else),
 * it would be great if you could give me feedback on this.
 * Thanks a lot and all the best
    Stefan
 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/variables-for-e-commerce-pixels/#post-6694844)
 * Hi,
 * I will go through all open thread in a couple of hours.
 * Thomas
 *  Thread Starter [Sonic55](https://wordpress.org/support/users/sonic55/)
 * (@sonic55)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/variables-for-e-commerce-pixels/#post-6694853)
 * Hi Thomas,
 * I dont want to bug you, but did you have a chance yet to look into my question?
 * Thanks
    Sonic
 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/variables-for-e-commerce-pixels/#post-6694854)
 * Hi Sonic,
 * First of all: I apologize for such a delay.
 * Second: are you using classic ecommerce tracking or enhanced ecommerce tracking?
   Either way all your requested data is available in the dataLayer.
 * For example: if you are using classic ecommerce, you should use the datalayer
   variable _transactionId_
    The same in enhanced ecommerce can be accessed using
   the datalayer variable ecommerce.purchase.actionField.id
 * For currency and classic ecommerce you can use transactionCurrency
    There is 
   currently no equivalent in enhanced ecommerce but this should be added to the
   plugin and I added it to the todo list.
 * Number of products is a but tricky, you will need to create a datalayer variable
   to access the transactionProducts variable for classic ecommerce or the ecommerce
   variable for enhanced ecommerce.
    Then you need to create a new JavaScript variable:
 *     ```
       function() {
         return {{transactionProducts}}.length;
       }
       ```
   
 * or for enhanced ecommerce
 *     ```
       function() {
         return {{ecommerce}}.purchase.products.length;
       }
       ```
   
 * I assume you use the same names on the GTM UI for the variables as they are named
   in the datalayer.
 * Price of each product: this is tricky as well as you will need another JS variable.
   Do you need to total value of the purchase or the price of a specific product?
 * Cheers,
    Thomas
 *  Thread Starter [Sonic55](https://wordpress.org/support/users/sonic55/)
 * (@sonic55)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/variables-for-e-commerce-pixels/#post-6694856)
 * Hi Thomas,
 * thanks a ton for your elaborate answer. I just wrote you a private message with
   a professional enquiry.
 * Thanks
    Sonic

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

The topic ‘Variables for E-Commerce Pixels’ 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/)

 * 5 replies
 * 2 participants
 * Last reply from: [Sonic55](https://wordpress.org/support/users/sonic55/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/variables-for-e-commerce-pixels/#post-6694856)
 * Status: not resolved