Is it possible to cast the value of a Marketo template variable (e.g., ${var1}) into an object type that can be used in Javascript? A simple example would be trying to output the value of ${var1} to the console:
<script>
console.log(${var1});
</script>
Given that var1 has been defined in the <head>:
<meta class="mktoString" mktoName="Variable 1" id="var1" default="This is a variable">
... the console errors out because ${var1} is translated into This is a variable, but not as a string.
Any ideas if/how this can be done?
Solved! Go to Solution.
Wrap in quotes.
Perfect. Thanks!