Title: Empty Datalayer
Last modified: June 17, 2018

---

# Empty Datalayer

 *  Resolved [kyler890](https://wordpress.org/support/users/kyler890/)
 * (@kyler890)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/empty-datalayer/)
 * Hello,
 * I implemented the plugin last night and set it up to work with a few pixels. 
   One thing I couldn’t figure out was that the ecommerce information isn’t being
   passed to the datalayer.
 * First I did it with my own purchase, and everything was there except the conversion
   value. It was 0.00.
 * I loaded a customer’s checkout url in a private browser and everything was empty.
 * Not sure if it’s something on my end, another plugin, or what. Was hoping you
   could help.
 * This is the information from the customer order
 * <!– Google Tag Manager for WordPress by DuracellTomi –>
    <script data-cfasync
   =”false” type=”text/javascript”>//<![CDATA[ var google_tag_params = {“pageTitle”:”
   Checkout – Stunt Stand\u00ae (Official)”,”pagePostType”:”page”,”pagePostType2″:”
   single-page”,”postID”:14,”customerTotalOrders”:0,”customerTotalOrderValue”:”0.00″,”
   customerFirstName”:””,”customerLastName”:””,”customerBillingFirstName”:””,”customerBillingLastName”:””,”
   customerBillingCompany”:””,”customerBillingAddress1″:””,”customerBillingAddress2″:””,”
   customerBillingCity”:””,”customerBillingPostcode”:””,”customerBillingCountry”:””,”
   customerBillingEmail”:””,”customerBillingPhone”:””,”customerShippingFirstName”:””,”
   customerShippingLastName”:””,”customerShippingCompany”:””,”customerShippingAddress1″:””,”
   customerShippingAddress2″:””,”customerShippingCity”:””,”customerShippingPostcode”:””,”
   customerShippingCountry”:””,”ecomm_prodid”:[],”ecomm_pagetype”:”cart”,”ecomm_totalvalue”:
   0,”ecommerce”:{“checkout”:{“actionField”:{“step”:2},”products”:[]}}}; dataLayer.
   push({“pageTitle”:”Checkout – Stunt Stand® (Official)”,”pagePostType”:”page”,”
   pagePostType2″:”single-page”,”postID”:14,”customerTotalOrders”:0,”customerTotalOrderValue”:”
   0.00″,”customerFirstName”:””,”customerLastName”:””,”customerBillingFirstName”:””,”
   customerBillingLastName”:””,”customerBillingCompany”:””,”customerBillingAddress1″:””,”
   customerBillingAddress2″:””,”customerBillingCity”:””,”customerBillingPostcode”:””,”
   customerBillingCountry”:””,”customerBillingEmail”:””,”customerBillingPhone”:””,”
   customerShippingFirstName”:””,”customerShippingLastName”:””,”customerShippingCompany”:””,”
   customerShippingAddress1″:””,”customerShippingAddress2″:””,”customerShippingCity”:””,”
   customerShippingPostcode”:””,”customerShippingCountry”:””,”ecomm_prodid”:[],”
   ecomm_pagetype”:”cart”,”ecomm_totalvalue”:0,”ecommerce”:{“checkout”:{“actionField”:{“
   step”:2},”products”:[]}},”google_tag_params”:window.google_tag_params});//]]>
   </script>
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fempty-datalayer%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/empty-datalayer/#post-10407662)
 * Hi,
 * Ecommerce data on the order received page is only added once, during the very
   first page load of this thank you page.
 * If you reload this page or revisit a later time, you will not see purchase information
   to prevent double tracking of such an info.
 *  Thread Starter [kyler890](https://wordpress.org/support/users/kyler890/)
 * (@kyler890)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/empty-datalayer/#post-10407691)
 * Fair enough. But when I check my pixel activity on Facebook, the only value that
   is getting pushed through is 0.00. I tested a couple of transactions and there
   was no customer order value.
 * Could you do a test purchase using a PO number so that it doesn’t charge you 
   anything, then see what might be happening?
 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/empty-datalayer/#post-10407694)
 * Before placing a test order: could you post a screenshot of your FB pixel tag
   that includes a GTM variable to pass order value? And also a screenshot about
   the settings of this GTM variable?
 *  Thread Starter [kyler890](https://wordpress.org/support/users/kyler890/)
 * (@kyler890)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/empty-datalayer/#post-10407743)
 * Activity from Facebook on the purchase event
 * > [View post on imgur.com](https://imgur.com/FBj6BJ4)
 * Variable in GTM
 * > [View post on imgur.com](https://imgur.com/a/SxIypHv)
 * From Facebook’s pixel helper
 * > [View post on imgur.com](https://imgur.com/a/k1pEbeG)
 * Variable from GTM (without the pixel ID)
 *     ```
       <!-- Facebook Pixel Code -->
       <script>
       !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
       n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
       n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
       t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
       document,'script','https://connect.facebook.net/en_US/fbevents.js');
   
       fbq('init', 'pixelid');
       fbq('set','agent','tmgoogletagmanager', 'pixelid');
       fbq('track', 'Purchase', {value: {{Order Total Value - Woocommerce}}, currency: 'USD'});
   
       </script>
       <noscript><img height="1" width="1" style="display:none"
       src="https://www.facebook.com/tr?id=pixelid&ev=PageView&noscript=1"
       /></noscript>
       <!-- End Facebook Pixel Code -->
       ```
   
 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/empty-datalayer/#post-10408856)
 * You should change the GTM variable to read this data layer item:
 * ecommerce.purchase.actionField.revenue
 * The variable you are using holds the life time value of the currently logged 
   in user (if any)
 *  Thread Starter [kyler890](https://wordpress.org/support/users/kyler890/)
 * (@kyler890)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/empty-datalayer/#post-10408865)
 * I can certainly do that. But that value seems to be $0.00 too
 *  Thread Starter [kyler890](https://wordpress.org/support/users/kyler890/)
 * (@kyler890)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/empty-datalayer/#post-10411239)
 * I updated my variable to ecommerce.purchase.actionField.revenue and now it’s 
   not passing anything to the Facebook pixel unfortunately
 * Just did another test purchase since you said it won’t show variables on old 
   orders.
 * Here’s the exact snippet from my datalayer without modifying anything
 * > [View post on imgur.com](https://imgur.com/a/VDKRA2W)
    -  This reply was modified 7 years, 11 months ago by [kyler890](https://wordpress.org/support/users/kyler890/).
      Reason: added snipped from test purchase
 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/empty-datalayer/#post-10412155)
 * The screenshot you provided in your prior post tells me that you are currently
   not on the “order received” page. The “ecommerce: {checkout: …” line means that
   you are on the page where you can enter your order details.
 * Can you provide a coupon so that I do not have to pay during a test checkout?
 *  Thread Starter [kyler890](https://wordpress.org/support/users/kyler890/)
 * (@kyler890)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/empty-datalayer/#post-10412475)
 * I was on the confirmation page. That’s what has me worried
 * Please put purchase order 0000 and make your name GTM Test
 * Thank you
 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/empty-datalayer/#post-10413538)
 * I see: for some reason, my plugin sees that the user is on the checkout page 
   while I see the success page.
 * On the code level this means that the standard WooCommerce function `is_cart()`
   return true while `is_order_received_page()` seems to return false.
 * What other plugin are you using to customize the checkout page to this multi 
   step checkout experience?
 *  Thread Starter [kyler890](https://wordpress.org/support/users/kyler890/)
 * (@kyler890)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/empty-datalayer/#post-10415103)
 * I believe it is the theme causing that experience. I would prefer it to be a 
   single page checkout.
 *  Thread Starter [kyler890](https://wordpress.org/support/users/kyler890/)
 * (@kyler890)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/empty-datalayer/#post-10424030)
 * Started working randomly. Marking resolved

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

The topic ‘Empty Datalayer’ 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/)

 * 12 replies
 * 2 participants
 * Last reply from: [kyler890](https://wordpress.org/support/users/kyler890/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/empty-datalayer/#post-10424030)
 * Status: resolved