0

I am having trouble with an undefined data layer variable with Google Tag Manager named ecomm_totalvalue (Please note I have also tried object.ecomm_totalvalue)

I am using WordPress/WooCommerce and GTM with duracelltomi-google-tag-manager to create and access the data layer.

The data layer works correctly and using the GTM inspector/preview I can view all the DLVariables (See image 1), however, they come up as undefined when I make data layer variables in Google Tag Manager and try to log them to the console with a GTM tag.

I am not sure what I am doing wrong here as the variables exist, I assume I am not calling them correctly!

Any help would be appreciated, please view images for more information.

Thank you!

Image 1 - GTM Preview

enter image description here

Image 2 - Data Layer Variable

enter image description here

Image 3 - Tag

enter image description here


(6) [Arguments(2), Arguments(2), {…}, {…}, {…}, {…}, object_observed: true, push: ƒ] 0: Arguments(2) ["js", Sun Sep 23 2018 17:54:21 GMT-0700 (Pacific Daylight Time), callee: ƒ, Symbol(Symbol.iterator): ƒ] 1: Arguments(2) ["config", "UA-01234567-1", callee: ƒ, Symbol(Symbol.iterator): ƒ] 2: customerBillingAddress1: "" customerBillingAddress2: "" customerBillingCity: "" customerBillingCompany: "" customerBillingCountry: "" customerBillingEmail: "" customerBillingFirstName: "" customerBillingLastName: "" customerBillingPhone: "" customerBillingPostcode: "" customerFirstName: "" customerLastName: "" customerShippingAddress1: "" customerShippingAddress2: "" customerShippingCity: "" customerShippingCompany: "" customerShippingCountry: "" customerShippingFirstName: "" customerShippingLastName: "" customerShippingPostcode: "" customerTotalOrderValue: "0.00" customerTotalOrders: 0 ecomm_pagetype: "other" pagePostAuthor: "user" pagePostType: "page" pagePostType2: "single-page" __proto__: Object

4
  • Downvote :( harsh Commented Sep 18, 2018 at 19:46
  • Could you please update the full list of the datalayer? Commented Sep 21, 2018 at 14:22
  • Hey @M.Kooi, is that what you need ^ updated Q Commented Sep 24, 2018 at 0:58
  • why is this downvoted? this is a great question with lots of info? Commented Jan 6, 2021 at 1:15

1 Answer 1

0

Just use ecomm_totalvalue in your data layer variable and make sure your tag is firing after the data layer variable is available. No need to test the variable in a custom HTML tag, you can see the value in the preview panel.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.