Problem with Google Analytics

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
masteragi
New Member
New Member
Posts: 1
Joined: Wed Dec 18, 2019 3:49 am

Problem with Google Analytics

Post by masteragi »

Hello

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

Code: Select all

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?

Thanks
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1627
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Problem with Google Analytics

Post by DIGI3 »

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.:

Code: Select all

{ datalayer.push(arguments); }
instead of

Code: Select all

{datalayer.push(arguments);}
and anywhere else in the script they appear.
Not getting the answer you need? CMSMS support options
Post Reply

Return to “Modules/Add-Ons”