Title: Persistent Data Layer Variable
Last modified: July 2, 2021

---

# Persistent Data Layer Variable

 *  [desmondng](https://wordpress.org/support/users/desmondng/)
 * (@desmondng)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/persistent-data-layer-variable/)
 * I am trying to push the information from the Data Layer into GA as well as other
   platforms for tracking. One of the issue I have faced is the Date Layer Variable
   for Product Name is not bringing forward from the cart page through to the thank
   you page.
 * My selection now:
    Order ID: orderData.attributes.order_number Product Name: 
   ecommerce.purchase.products.name Revenue: ecommerce.purchase.actionField.revenue
 * but the Product name is not being captured. And the variables above are only 
   appearing on the thank-you page, means I can’t confirm them on the cart / checkout
   page.
 * Do you have a list of recommended Data Layer Variables for Product purchase? 
   I’m referring to the list here [https://gtm4wp.com/how-to-articles/what-is-in-the-datalayer-when-using-this-wordpress-plugin](https://gtm4wp.com/how-to-articles/what-is-in-the-datalayer-when-using-this-wordpress-plugin)
   but nothing on products.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fpersistent-data-layer-variable%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/persistent-data-layer-variable/#post-14618966)
 * Hi,
 * GTM4WP implements the enhanced ecommerce data layer of Google for both Universal
   Analytics and Google Analytics 4:
 * [https://developers.google.com/tag-manager/ecommerce-ga4](https://developers.google.com/tag-manager/ecommerce-ga4)
   
   [https://developers.google.com/tag-manager/enhanced-ecommerce](https://developers.google.com/tag-manager/enhanced-ecommerce)
 * For the product name, it is important to see that the “products” key is an array
   thus you need to reference it so: ecommerce.purchase.products[0].name (for the
   first product in the cart) or ecommerce.purchase.products.0.name if you reference
   it in a Data Layer Variable.

Viewing 1 replies (of 1 total)

The topic ‘Persistent Data Layer Variable’ 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

 * [data layer](https://wordpress.org/support/topic-tag/data-layer/)
 * [GTM4WP](https://wordpress.org/support/topic-tag/gtm4wp/)

 * 1 reply
 * 2 participants
 * Last reply from: [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/persistent-data-layer-variable/#post-14618966)
 * Status: not resolved