Title: Data Layer Undefined
Last modified: January 3, 2018

---

# Data Layer Undefined

 *  [jmosquera](https://wordpress.org/support/users/jmosquera/)
 * (@jmosquera)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/data-layer-undefined/)
 * Hi Thomas!
    First of all thank you for the plugin, really helpful.
 * I followed the steps you gave in one of the posts regarding the variables and
   the enhanced ecommerce tracking for GA.
    Product Name –> ecommerce.add.products.
   0.name Product Price –> ecommerce.add.products.0.price I have been receiving 
   data properly into GA but now I see the datalayer shows Product Name and Product
   Price as Undefined. Is that normal?
 * I am trying to implement as well the Facebook pixel and Facebook don’t get the
   value details
 * Should I need to create new variables or the ones I settled up are enough?
 * Many thanks in advance,
    Jorge
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdata-layer-undefined%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/data-layer-undefined/#post-9829864)
 * Have you changed or upgraded your theme on the site?
    When I open your product
   detail page, some key codes are missing from my plugin: [https://www.palets.com/composicion/sofa-2-plazas/](https://www.palets.com/composicion/sofa-2-plazas/)
 * From what I can see in the source code of the page, this does not seem to be 
   a normal WooCommerce product detail page, is it?
 *  Thread Starter [jmosquera](https://wordpress.org/support/users/jmosquera/)
 * (@jmosquera)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/data-layer-undefined/#post-9829874)
 * Thanks for the quick answer.
 * Yes, this is part os specific pages created for self product selection but I 
   have this other “shop” link were I think follows WooCommerce product details 
   page:
    [https://www.palets.com/tienda/](https://www.palets.com/tienda/)
 * All those products here suppose to be normal WooCommerce product pages…
 * Thanks again,
    Jorge
 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/data-layer-undefined/#post-9829884)
 * By your definition and based on how they look like, they are product detail pages.
 * The problem is that the WooCommerce core function is_product() does not recognize
   this page as a single product page which also prevents my plugin to detect this
   kind of content and the the proper, detail product specific codes.
 *  Thread Starter [jmosquera](https://wordpress.org/support/users/jmosquera/)
 * (@jmosquera)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/data-layer-undefined/#post-9829899)
 * Ouch!
 * So what could be the solution?
    It is strange that I can see my product names
   and prices on Google Analytics but not in the datalayer, right?
 * Any recomendation?
 * Thanks,
    Jorge
 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/data-layer-undefined/#post-9829945)
 * In what report do you see product names?
 * My assumption is that products and product names can be correctly sent in product
   list impressions, maybe clicks and also while the product is in the checkout 
   and also your transactions but add to cart data is missing.
 * The only solution here would be to ask the theme or plugin developer (I do not
   know whether this custom product page functionality is offered by the theme or
   another plugin) to mimic the is_product() function of WooCommerce on those custom
   pages:
    [https://github.com/woocommerce/woocommerce/blob/master/includes/wc-conditional-functions.php#L76](https://github.com/woocommerce/woocommerce/blob/master/includes/wc-conditional-functions.php#L76)
 *  Thread Starter [jmosquera](https://wordpress.org/support/users/jmosquera/)
 * (@jmosquera)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/data-layer-undefined/#post-9829963)
 * I can see Product name and Price on Google Analytics Conversions tab > General
   View.
 * The strange thing here is that even when I am on a checkout page (test purchase)
   I enter into the variables and I see them as undefined…
    If they are flowing 
   into GA it’s supposed those variables should appear well
 * Thanks,
    Jorge
 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/data-layer-undefined/#post-9832851)
 * I’ve added a product to the cart on your site and moved to the checkout page.
   
   Here I can see that the checkout data is being sent to GA correctly. I placed
   a test order which showed that the product data is sent to GA here as well.
 * What do you see if you open the Product List Performance report in GA and switch
   the primary dimension to Product? I guess you will see numbers in the checkout
   and purchase columns but nothing in the add to cart column?
 *  Thread Starter [jmosquera](https://wordpress.org/support/users/jmosquera/)
 * (@jmosquera)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/data-layer-undefined/#post-9833603)
 * Thanks!
 * I see all the info, the split by product and price, incomes, all the details 
   perfectly with product name and percentages.
    Even if I select the dimension 
   by category it shows me the 3 categories I have on the store.
 * Regards,
    Jorge

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

The topic ‘Data Layer Undefined’ 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/)

## Tags

 * [datalayer](https://wordpress.org/support/topic-tag/datalayer/)
 * [gtm](https://wordpress.org/support/topic-tag/gtm/)
 * [variables](https://wordpress.org/support/topic-tag/variables/)

 * 8 replies
 * 2 participants
 * Last reply from: [jmosquera](https://wordpress.org/support/users/jmosquera/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/data-layer-undefined/#post-9833603)
 * Status: not resolved