Adding Google Analytics Code To phpLD

I recently started a niche web directory, and I’m using phpLD. When I went to add the Google Analytics code to my template, I had an issue.

Because phpLD uses the Smarty templating system, simply opening the footer.tpl and placing the Analytics code before the closing body tag will result in an error. You need to tell Smarty not to parse the code between the script tags. To do so, open your templates/footer.tpl file, and right before the closing body tag, place your Google code like this:

{literal} Your-Analytics-Code-Here {/literal}

It’s as simple as that! Enjoy.

Enjoyed this post?
Subscribe to Zander Chance via RSS Feed or E-mail and receive daily news updates!

Submit to Digg  Stumble This Story  Share on Twitter  Post on Facebook  Post on MySpace  Add to  Submit to Reddit  Fave on Technorati

Leave a Reply