WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use piwik analytics to track the visitors to my website. I recently created a blog on WordPress and wanted to added the same tracking code that I use on the plain HTML webpage. How can I added the tracking script in the php in order to track my blog visitors?


share|improve this question
This plugin helps to include tracking-codes (not only for Piwik, but also Google Analytics etc). – user31458 Apr 13 '13 at 20:08
up vote 1 down vote accepted

Add the tracking code to one of your theme files, most likely footer.php.

The easiest way to do this is to go to your admin panel and go to Appearance > Editor, and on the right side, find the entry for Footer (footer.php), and then insert the code right before the closing </body> tag. Update the file by clicking the button below the text box, and you should be good!

share|improve this answer
Thank you, I was adding it to my templates but the footer worked much better! (I'd give you an upvote but alas not enough rep!) – Nick Aug 15 '11 at 12:56
No problem, glad it worked! – Joshua Aug 16 '11 at 1:04

You'll find Step by step instruction on how to install Piwik on the Wordpress site here.

share|improve this answer
+1, but an answer should be more than a link. Please read a bit in the FAQ to get a better feeling how this site works. Thanks. – kaiser Oct 8 '12 at 8:37
The external website is about installing Piwik via Cpanel ... so most of the article is not related to the original question. @wpboss ... its ok to answer a question and reference an article on your own website, but don't over do the linkbaiting / SEO – Damien Oct 8 '12 at 8:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.