Its pretty common to encounter the scenarios listed
The webmaster / web site administrator has no control over the website / application code
Add the tracking code to all pages of the web application is a very cumbersome process / no bandwidth with the development team for this effort.
The option listed below can be used to add the tracking code to all pages. The snippet below works for the Apache Web Server. I haven’t got a chance to find out other equivalents on IIS and other servers.
Pre-reqs
Apache Web Server is already installed and website is running smoothly
You have access to edit the configuration of the web server and/or you have access to the admin who does this for you
Process.
Compile mod_substitute and mod_ext_filter and add them as DSO modules
In the above code it is assumed that the tag is present. In case its not view the source of your page and add an appropriate tag. I would recommend placing this script at the bottom of the page.
Replace siteid=“XX” with the value of the website configured via the Piwik Admin Screen.
Inside the customscript.js place the javascript tracking code
Your above post is sort of confusing. My problem is that I can not locate my tracking code, where do I cacate it, and which of the above is the tracking coce a man might be able to use for Wordpress?
Once you have a fully running setup of Piwik installed and have added a website, you will be able to get the tracking code for your website by logging into the Piwik Admin Page
Go to Settings (link on right top) --> Websites tab --> Select the Website you have setup and then scroll to the right to “view the tracking code”
@ismaelpuerto, if you don’t provide a link or a more specific error report, we can’t help you. Please provide a link to your website’so people can take a look and make sure the tracking code is working.
Thought I would offer another option for those looking. I have had pretty good success injecting a php script into my index.html files as Apache is serving them. A simple FilesMatch directive does the trick for me. Another perk of this approach is that it gives me the freedom to use global server variables in the tracking script for user identification and the like. My tracking.php is just the standard javascript with a few php phrases and if() statements to ensure I only pass those variables to Piwik if a user has logged in.
Note: this approach requires libphp5.so (php5). I keep the code listed below in a virtual host config file, but that’s just my preference as my setup keeps all my config in virtualhost config files, rather than using .htaccess files.