One problem with this scenario is that you are editing a WordPress core file which will get over written each time you upgrade WordPress. Also, you may not want to get into the habit of editing WordPress core files. I searched for a n Open Web Analytics plugin that would inject code into each WordPress post or page so that I could track website visitors.
I found such a plugin called Open Web Analytics Plugin by Christian Schmidt. However, this plugin was developed nearly 7 years ago. This plugin may or may NOT work with newer WordPress versions.
Looks as if this plugin was abandoned years ago. Proceed with caution and AnetComputers.com is not responsible for problems with your website. I will now give you instructions on how to install and configure this plugin.
Login to your WordPress dashboard. Click on "Plugins". Now click on "Add New".
Type in "owa" without quotes into a search box. Look for "Open Web Analytics Plugin" by Christian Schmidt. Click on "Install Now".
Click on OK at the "Are you sure you want to install this plugin now" warning pop up. The plugin should download and install. Click on "Activate" to make this plugin live.
Under "Settings" there will be an option titled apropos "Open Web Analytics". Choose that option and you will taken to this plugins settings. This is where you configure this plugin to grab data from open web analytics that you already installed.
You have to enter your open web analytics site ID into the first field. You must login with your admin account into the open web analytics tracking system. Click on "Edit Profile" for the website that you want to integrate with WordPress.
You will see your "Site ID" under "Site Profile". This is a lengthy alphanumerical string. Copy and paste this site ID into the first configuration field in the WordPress plugin configuration. You can have this plugin track "Downloads".
You can add in the host name of the server where you installed open web analytics. This is entirely optional. For example I would enter in www.anetcomputers.com.
The "Base URL of installation" should already be filled in with /owa/. For example if you installed open web analytics into the owa directory under your web root, then you should see /owa/. However, if you changed the installation folder on your web server from /owa/ to say /stats/ then you want to change /owa/ to /stats/ in this field. You can optionally track the admin user with this tool.
Place a check next to "Track the admin user too". Now click on "Update Settings". Now you get to test if this plugin is working. Browse to your website so that this open web analytics detects a visitor.
In the open web analytics administrator back end you should see:
0 Visits 0 Page Views 0.00 % Bounce Rate
Now that you just visited your website, you should see some statistics for your website. Click on "Tracked Sites" from the main administrator dashboard. AnetComputers.com should show at least this:
1 Visits 1 Page Views 100.00 % Bounce Rate
If you were to click on an addition page you should see this:
1 Visits 2 Page Views 0.00 % Bounce Rate