Syntax for pushing a value to GTM DataLayer

125 Views Asked by At

Please advise on how to push to GTM dataLayer the value below step by step (I'm not a developer).

document.getElementById("mytdId").innerText

Thanks a lot.

1

There are 1 best solutions below

0
On

ok i found a way around which works , here the snippet :

Hi 

    function (){ 
var topMenu = document.getElementById("dm1m0i1tdT").innerText;
return(topMenu);
}

To improve the syntax you suggest an array but don't know how to handle that in this case here. Any suggestion ?