CMS Made Simple Forums

Problem with Google Analytics
Page 1 of 1

Author:  masteragi [ Wed Dec 18, 2019 3:53 am ]
Post subject:  Problem with Google Analytics


I tried to add Google Analytics code but it has this error

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

Anyone know how to fix this?


Author:  DIGI3 [ Wed Dec 18, 2019 3:57 pm ]
Post subject:  Re: Problem with Google Analytics

In CMS Made Simple, curly braces {} are reserved for Smarty functions. Because your script uses them, you will need to do one of two things to avoid this:

option one:
wrap the script in {literal} script goes here {/literal} tags

option two:
make sure the script has spaces after any opening curly brace, e.g.:
{ datalayer.push(arguments); }

instead of

and anywhere else in the script they appear.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group