Live Chat Software by IXXO |
"Smarty Error" with Google Analytics Tracking Code
Posted by Steve Naqvi on 03 May 2012 03:01 AM
|
|
Use {Literal} Smarty Tag to Add Google Analytics Tracking CodeThe error happens because Smarty template engine attempts to translate and interpret some keywords in Google Analytics tracking code that conflict with Smarty template delimiter syntax. As a workaround, Smarty does provide tags, {literal} and {/literal}, which allows a block of data to be taken literally. {literal} tags are typically used around Javascript or stylesheet blocks where {curly braces} would interfere with the template delimiter syntax. Anything within {literal}{/literal} tags is not interpreted, but displayed as-is. It means anything inside the tags will be appeared exactly the same in the final HTML output for web browser to interpret, and no change will be done by Smarty engine. Thus, to fix Google Analytics tracking code error on BlogSome, just embed the tracking code with{literal} before Google Analytics Javascript code, succeeding with {/literal} after the tracking. For example, {literal} | |
|