Tracks only visits to my localhost version of the website

Thanks for the excellent product. However, it seems to track only visits to the localhost version of my website.

Here is what I did:

  1. I installed piwik using the ftp method. I got an error regarding the first item in the optional part (in the 2nd screen of the installation process). The error said something about (Try whitelisting this URL from HTTP Authentication and disable mod_security.) However, since it was part of the “optional” area, I ignored the error, and continued. Every thing went very smooth afterwards.

  2. I added several websites to piwik. Then, I copied the tracking JavaScript codes to the web pages on my local computer.

  3. Then, I uploaded the new updated pages (having the JavaScript tracking code) to my shared hosting server.

Tracking worked for all of them. However, tracking seems to work only when I access the pages, which are on my localhost (my laptop computer), e.g. (localhost/web/site111). Moreover, accessing the pages, which are on the same webhost that piwik is installed on, also works. To clarify, piwik is installed on (site222.com.au/piwik/), accessing the pages on (site222.com.au) is tracked correctly.

Accessing the pages, which are on the webhost server, e.g.(site111.com.au), does not get reported by piwik. This is my problem.

FYI, my web pages have tracking code for Google Analytics as well. I tried removing that from my pages. This did not seem to fix the problem.

Moreover, I opened the html/php files, which are on the webhost, to double-check that they have the tracking code in them.

Following is one of the tracking codes used:

Your help will be highly appreciated… :slight_smile:

For what it is worth, I found some additional information. I am really disparate to start tracking the traffic on my website. Your help is highly appreciated…

I cleared the browser’s cookies and cache. This did not help.

I have noticed that the web page produces a (403 error) for the piwik request. Following are the relevant details (from Google Chrome View Source --> Network)

Link Address:
http://buildwebsitepro.com.au/piwik/piwik.php?action_name=Maxi%20Taxi%20Now%20provides%20Maxi%20Taxi%20%2F%20Cab%20services%20for%20Sydney%2C%20Australia%2C%20including%20group%20and%20wheel%20chair%20transfer%20services&idsite=1&rec=1&r=934949&h=20&m=16&s=50&url=http%3A%2F%2Fmaxitaxinow.com.au%2F&_id=1ed11cad33f8fac0&_idts=1415610892&_idvc=1&_idn=0&_refts=0&_viewts=1415610892&pdf=1&qt=1&realp=0&wma=0&dir=0&fla=1&java=1&gears=0&ag=1&cookie=1&res=1366x768&gt_ms=997

Request Header:
GET /piwik/piwik.php?action_name=Maxi%20Taxi%20Now%20provides%20Maxi%20Taxi%20%2F%20Cab%20services%20for%20Sydney%2C%20Australia%2C%20including%20group%20and%20wheel%20chair%20transfer%20services&idsite=1&rec=1&r=934949&h=20&m=16&s=50&url=http%3A%2F%2Fmaxitaxinow.com.au%2F&_id=1ed11cad33f8fac0&_idts=1415610892&_idvc=1&_idn=0&_refts=0&_viewts=1415610892&pdf=1&qt=1&realp=0&wma=0&dir=0&fla=1&java=1&gears=0&ag=1&cookie=1&res=1366x768&gt_ms=997 HTTP/1.1
Host: buildwebsitepro.com.au
Connection: keep-alive
Cache-Control: max-age=0
Accept: image/webp,/;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36
Referer: http://maxitaxinow.com.au/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6,ar;q=0.4

Response Header:
HTTP/1.1 403 Forbidden
Server: nginx/1.6.2
Date: Mon, 10 Nov 2014 09:17:01 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Last-Modified: Wed, 03 Sep 2014 09:21:55 GMT
Content-Encoding: gzip

Could the problem be related to some default security setting on the shared web hosting service (on hostGator), which I am using?

Yes that’s possible, please see: 301 Moved Permanently

Matt,
Thanks. One of the suggested solutions in the post, which you referred me to, is to change the posting method from GET to POST. However, it seems that the instructions given do not apply to the current version of piwik.

They said:
Before the line piwikTracker.trackPageView(); you can add the following line piwikTracker.setRequestMethod(‘POST’);

However, I could not find the above mentioned code in my JS tracking code. Where should it go in my tracking code (below)?

By the way, I have the same problem with websites hosted on other web hosts, i.e. GoDaddy (shared hosting) and biz.ht (free hosting). To summarize, I have 3 websites hosted on 3 different web hosts. However, all of them are tracked (but not yet working) by a single piwik installation. This piwik installation is hosted on a HostGator website.

I found the solution, which you mentioned in (another post).

For others who might land here looking for a solution to a similar issue:

Before the line _paq.push([‘trackPageView’]); I added the line _paq.push([‘setRequestMethod’, ‘POST’]);

This changes the posting method from GET to POST, which seems to cause no security issues.

Thank you, Matt … :slight_smile: