Struggling to add in my Google analytics code at the bottom of </head>
It says this
Syntax error in template "template:appdata;tmp_template" on line 21 "function gtag(){dataLayer.push(arguments);}" - Unexpected ".", expected one of: "}"
No content blocks defined in template
This is the piece of code that google has given me and it doesn't like it?
Anyone have any thoughts?
Cheers
Google Analytics add
Re: Google Analytics add
CMSMS thinks anything surrounded by braces is a Smarty template tag and will try to process it.
You can either let Smarty know not to try parsing the code by wrapping the javascript in {literal} {/literal} tags, or you can add a space immediately after the opening brace so that Smarty doesn't think it's a tag.
or
s.
You can either let Smarty know not to try parsing the code by wrapping the javascript in {literal} {/literal} tags, or you can add a space immediately after the opening brace so that Smarty doesn't think it's a tag.
Code: Select all
{literal}
function gtag(){dataLayer.push(arguments);}
{/literal}
Code: Select all
function gtag(){ dataLayer.push(arguments); }