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

106
Views
GoogleTagManager's custom HTML doesn't work well to put numbers in variables

Problem

I'm creating custom HTML with GoogleTagManager, but I can't put a number string in the getTimeStamp. Also, GTM does not support ES6, so it is essential to write ES5.

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());
 var getTimeStamp = nowDate;

if (!window.dtlpcvCvConf) {
  window.dtlpcvCvConf = [];
}
window.dtlpcvCvConf.push({
  siteId: "xxx",
  commitData: {
    pid: "xxxx",
    amount: "",
    mid: "",
    u: getTimeStamp, 
    t:"xxx",
    cvinfo:"xxx"
    }
});
</script>
<script src="https://dep.tc/public/js/lpcv.js?cid=xxx&pid=xxx&t=xxx" async="async"></script>

about 4 years ago · Juan Pablo Isaza
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!