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

436
Views
Error : this language feature is only supported for ECMASCRIPT6 mode or better 【Google Tag Manager】

When I create a custom-html tag in Google Tagmanager I get this error:

JavaScript Compiler Error Typeform Tag Error at line 11, character 22: This language feature is only supported for ECMASCRIPT6 mode or better: const declaration.

The same error occurs for line 22.

This is my code:

<script>
 function formatDate(dt) {
    var y = ('00'+dt.getFullYear()).slice(-2);
    var m = ('00' + (dt.getMonth()+1)).slice(-2);
    var d = ('00' + dt.getDate()).slice(-2);
    var h = ('00' + dt.getHours()).slice(-2);
    var mm = ('00' + dt.getMinutes()).slice(-2);
    return (y  + m + d +  h  + mm);
 }
 nowDate = formatDate(new Date());
 const getAfbItem = `${nowDate}`;

if (!window.dtlpcvCvConf) {
  window.dtlpcvCvConf = [];
}
window.dtlpcvCvConf.push({
  siteId: "",
  commitData: {
    pid: "",
    amount: "",
    mid: "",
    u: `${getAfbItem}`, 
    t:"",
    cvinfo:"1.1.1"
    }
});
</script>

Please, share your thoughts or any advices, would highly appreciate it! - thanks you in advance.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Template literals (with the `) were introduced in ES6.

Since you are only using it as ${<variable>}, you are probably fine with just <variable>, you don't need to put it in a literal. If it isn't already a string, you can convert it to a string with ""+<variable>.

const and let similarly were introduced in ES6, just replace them with var. They behave slightly differently, but it is fine for most use-cases.

I'm not familiar with GTM, but this is probably a restriction to reach the widest audience possible.

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!