Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

266
Vistas
Parse error. '}' expected when using dot notation with data layer variable data

I have an object that I have added to the datalayer that has an array in it. In a custom html tag (javascript), I can pull the data out just fine. And it is still a well formed object. But when I use the dot notation to access the array, Tag Manager gives the error

Error at line 10, character 39: Parse error. '}' expected

Line 10 is the authData line below. And this happened when I click the Preview button to test the changes.

<script>
    var dlv = {{dlv - My-Variable}};
    var authData = { email: dlv.Items.0.Shipment.Address };
</script>

I have followed the steps in this post. https://www.simoahava.com/gtm-tips/access-array-members-in-the-data-layer/

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

An element in an index-dased array should be accessed using square bracket notation, like someArray[5]

 var authData = { email: dlv.Items[0].Shipment.Address };

And a variable can't have "-" in its' name, because it's confusing JavaScript, wheteher "-" should be treated as arithmetical operator or as a part of a variable name

 My-Variable

And the interpolation braces are used in JSX, not in JavaScript

 {{ }}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda