=====Using JavaScript inside SMARTY Templates=====
**Update for v6:** The software now uses SMARTY 3, which handles this a little differently. In short, SMARTY now ignores any { characters that are immediately followed by whitespace. allowing JavaScript to parse them correctly. The practical upshot of that is that **most** scripts will now work without the below modifications. If not, or if you're not sure, it's always safe to make these changes anyway.
On occasion, it may be appropriate to add a block of JavaScript code to one of your template files. One of the most common uses of this is when adding Google Analytics to a site. There is one important caveat to be aware of: both JavaScript and SMARTY have different interpretations of the left-curly-brace character **'{'** -- if you try to insert JavaScript code containing {curly braces} into a SMARTY template file, SMARTY will attempt to interpret the braces as its own tags, which will usually break the JavaScript code.
There are a couple of ways around this. You can either replace all of the left-curly-braces in your Javascript with the {ldelim} tag, or you can simply wrap the entire javascript code in **{literal}{/literal}** SMARTY tags.
**Google Analytics Tip:** If you are trying to use Google Analytics: Edit the **footer.tpl** template file in the admin panel under **Design > Manager**. Click on the **<..> Source Code Editor** tab. Right before the end **