Adding Google Analytics Code to a phpLD installation
November 29th, 2008
Here’s a quick post to help you add Google Analytics tracking code to your phpLD (php link directory) template. 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}
Now save and put. That’s it!



Thanks. A simple answer to a common question.
Nice one! Thanks for the tip, saved me a bunch of headaches.
Dave
I was driving myself mad trying to work out how to escape the Google Analytics tag code, until I gave up, did a Google search and found your post. Problem solved! Wish I’d done that earlier. Thank you
thank you for this howto
thanks for the easiest explanation to how add google analytics to phpLD
This helped me a lot, thank you very much for posting the beginning and ending code!
Regards,
Steven.
Ha ha so simple now, one minute back it was like mountain. Thank you
After 3 sites who try to explain how to add this code your the first one who realy helped.
Thanks!
Thank you for this fix – I’d tried several things and was starting to get quite frustrated. Nice to see a easy solution to it.
Thank you for this tutorial
Thanks a million – i spent way too much time trying to do this myself and it was this easy!!!
Worked perfectly for me – I wasted ages trying to add the script before reading this page.
Cheers
Thanks so much. I couldn’t figure out why it wasn’t working! Saved me hours of debugging.