07-26-2023, 05:45 PM
I'm trying to add a new google analytics event in a form.
So I have something like this :
<a href="#" name="button1" onclick="dataLayer.push({'event': 'button1-click'});" >Button 1</a>
So far, so good. But I get this weird smarty error :
Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "C:\wamp\www\mycookit/themes/cookit/delivery.tpl" on line 164 "dataLayer.push({'event': 'event_name'});" - Unexpected ": ", expected one of: "}" , " "' in C:\wamp\www\mycookit\tools\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 431
Has this ever happened to annyone? Is it prestashop? Is it just me?
I never had any problem doing this on other websites but none of them where on prestashop or smarty.
So I have something like this :
<a href="#" name="button1" onclick="dataLayer.push({'event': 'button1-click'});" >Button 1</a>
So far, so good. But I get this weird smarty error :
Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "C:\wamp\www\mycookit/themes/cookit/delivery.tpl" on line 164 "dataLayer.push({'event': 'event_name'});" - Unexpected ": ", expected one of: "}" , " "' in C:\wamp\www\mycookit\tools\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 431
Has this ever happened to annyone? Is it prestashop? Is it just me?
I never had any problem doing this on other websites but none of them where on prestashop or smarty.