Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

267
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!