Adding Google Analytics Code to a phpLD installation


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!

Similar Posts:

  1. #1 by Brad - December 7th, 2008 at 16:57

    Thanks. A simple answer to a common question.

  2. #2 by Dave Sohigian - February 16th, 2009 at 22:41

    Nice one! Thanks for the tip, saved me a bunch of headaches.

    Dave

  3. #3 by SEO Consultant - February 23rd, 2009 at 20:39

    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

  4. #4 by Simone - April 3rd, 2009 at 07:04

    thank you for this howto

  5. #5 by Simone - April 3rd, 2009 at 07:05

    thanks for the easiest explanation to how add google analytics to phpLD

  6. #6 by Steven - May 17th, 2009 at 14:05

    This helped me a lot, thank you very much for posting the beginning and ending code!

    Regards,
    Steven.

  7. #7 by prem - May 19th, 2009 at 05:32

    Ha ha so simple now, one minute back it was like mountain. Thank you

  8. #8 by Pieter - May 28th, 2009 at 13:02

    After 3 sites who try to explain how to add this code your the first one who realy helped.

    Thanks!

  9. #9 by Haunch - August 1st, 2009 at 00:45

    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.

  10. #10 by Images - August 21st, 2009 at 02:30

    Thank you for this tutorial

  11. #11 by Jacob - August 26th, 2009 at 11:46

    Thanks a million - i spent way too much time trying to do this myself and it was this easy!!!

  12. #12 by Weddings - December 6th, 2009 at 14:16

    Worked perfectly for me - I wasted ages trying to add the script before reading this page.

    Cheers

  13. #13 by Andrew Saladino - December 20th, 2009 at 22:19

    Thanks so much. I couldn’t figure out why it wasn’t working! Saved me hours of debugging.

(will not be published)
  1. No trackbacks yet.