1

I need to fetch some data from dataLayer in the Custom Javascript variable, but when I inspect dataLayer, it's always empty even that I have pushed values to dataLayer before I run the GTM script. Does anyone know if its possible to get values from dataLayer in custom javascript variable?

1
  • So is your problem that you do not know how to access the variable (then see Numm3ns answer), or is your problem with the push since you are saying that the dataLayer is empty (which btw. should never happen, there should be at least GTMs default events). Can you show the code that you use to push values ? Commented Nov 9, 2015 at 8:14

1 Answer 1

3

The answer to this question is to use the normal brackets {{variable_name}} to get the value of dataLayer variables

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.