google tag manager - When should variables be quoted in GTM custom html tag? -


i trying implement facebook pixel via gtm, , hitting few oddities.

i implementing via custom html tag, , if dont quote variables, gtm debugger shows them google_tag_manager["<id>"].macro(\'gtm123123123\')in debugger, instead of value itself. if surround use of variable quotes, see value itself.

if {{user email}} translated javascript code seeing, presume quoting isnt required?

if need quote, how write code like? em: ({{user email}} || "").tolowercase(),

which recommended? how decide?

also debugger surrounds entire tag in '' expected?

in custom html tags reference variables double brackets per example, without quotes. e.g.

var useremail = {{user email}}; 

the preview mode debug panel showing non-executed version of custom html tag. '' wrapped around script in panel output expected. why variables not showing values, instead seeing internal gtm reference variable.

if need test variable can temporarily include console.log(); ensure values resolving correctly. e.g.

var useremail = {{user email}}; console.log(useremail); 

Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -