Web Development Blog
Google Analytics 500 Server Error
  • Posted:
  • December 10, 2013
  • Comments:


I recently was contracted for SEO improvements to MStevensRoofing.com. This site never had Google Analytics Tracking incorporated, so naturally I wanted to get that up & running right away. I’ve done this so many times, but this time I encountered an issue I had never faced before. When I pasted in the code, The site crashed and generated a 500 Internal Server Error. To make a long story short, the issue was that the website was created using the Smarty Template Engine. The curly brackets in the tracking code screw up the templating engine that relies on curly brackets as the foundation of the coding engine.

The solution is to enclose the tracking code in a {literal}  …  {/literal} code block. Paste it within that block and your problems will be solved!

Shout out to Logicia.co.uk blog for opening my eyes to this.

Related Stack Overflow Thread.

No Comments
Leave a Comment