Site behind VPN (but which has internet access) not showing up in reports

Hi

I have a site which is behind a VPN and I have Piwik installed on a web server sat on the internet. While the google analytics code in the VPN site is able to send data to my Google Analytics account, the Piwik code is not sending data. Below is the code I have in my VPN web site pages. Is there something I need to do here to get it to start sending data to the foobar site?


<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://foobar.com/piwik/";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', 1]);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
    g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
  })();

</script>
<noscript><p><img src="http://foobar.com/piwik/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->


This looks good! it should help. For troubleshooting see: Tracking HTTP API: API Reference - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3

I installed Firebug and added the tracking code to piwik’s config ini. I then opened two windows. One to my piwik installation and one for the remote site that I want tracking info for. I visited some pages on the remote site but no POST or GET HTTP requests were sent to piwik it would seem (I had the Firebug console enabled to monitor the http requests).

Just to reiterate that the google analytics code seems to be sending the tracking info fine, but I’d much prefer to use Piwik if possible.

Any ideas why it’s not sending the HTTP requests to Piwik?

Can I just add, not that I’m entitled to any kind of turn around time here, but I’ve really only got today and tomorrow to get this sorted before I fly out to the event location and do my main work (photography). I could really do with sorting this out before then or I’ll have to make do with Google Analytics. So I appreciate in advance any help you can give me before then.

Thanks!

See the list: Piwik doesn't track any visits and pages, and shows "There is no data for this report" in all reports. - Analytics Platform - Matomo

Otherwise put your domain name with the Piwik tracking code on it and we can take a look!

I cannot do that I’m afraid as that site with the tracker code is behind a VPN. You wouldn’t be able to access it. I copied the tracking code in my first post.

I’ve tried replacing the piwik url with the ip address but it still didn’t work. However using Firebug I do see the GET Request sent - here’s what goes out.

URL Parameters being sent


http://ourspaceonthenet.com/piwik/piwik.php?action_name=Galleries%20-%20Best%20of%20Event%202014%20-%20Web%20Galleries&idsite=1&rec=1&r=051658&h=15&m=51&s=4&url=http%3A%2F%2Ffoo.bar.com%2Fgalleries.php&urlref=http%3A%2F%2Ffoo.bar.com.com%2Findex.php&_id=7c4a630c8bbff7c6&_idts=1398768781&_idvc=3&_idn=0&_refts=0&_viewts=1398771939&pdf=1&qt=0&realp=0&wma=0&dir=0&fla=1&java=1&gears=0&ag=1&cookie=1&res=1920x1080&gt_ms=181

HTTP Request Headers


GET /piwik/piwik.php?action_name=Galleries%20-%20Best%20of%20Event%202014%20-%20Web%20Galleries&idsite=1&rec=1&r=051658&h=15&m=51&s=4&url=http%3A%2F%2Ffoo.bar.com%2Fgalleries.php&urlref=http%3A%2F%2Ffoo.bar.com%2Findex.php&_id=7c4a630c8bbff7c6&_idts=1398768781&_idvc=3&_idn=0&_refts=0&_viewts=1398771939&pdf=1&qt=0&realp=0&wma=0&dir=0&fla=1&java=1&gears=0&ag=1&cookie=1&res=1920x1080&gt_ms=181 HTTP/1.1
Host: ourspaceonthenet.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Referer: http://foo.bar.com/galleries.php
Cookie: piwik_auth=login%3Dczo3OiJkcGV1c2VyIjs%3D%3Atoken_auth%3DczozMjoiYTBiMTg4Mjg3ZDAwMDNmYmJlMjg3MDBjYWRjMDk5OWQiOw%3D%3D%3A_%3Dbf286896604e80e95da51f63bd25bf15fb1c73bb; cprelogin=no; cpsession=ourspace%3akoUKQhFhbmEOGkuiTtEayG0ubEdPKXBa5DdVF6vKdgJd0XsfGUFyuaWQ7rCIttoi%2c40d2d1e5cec3f723f1ae8872dc974006b07f46d96c2fc3b376f03ccf92a890fa; langedit=; lang=; PIWIK_SESSID=18c407961b67e861ca344a92984a89aa
Connection: keep-alive

HTTP Response Headers - shows that it receives a positive response from Piwik server but nothing appears in the Dashboard or real time views, or visitor log.


HTTP/1.1 200 OK
Date: Tue, 29 Apr 2014 14:51:04 GMT
Server: Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
X-Powered-By: PHP/5.3.20
P3P: CP='OTI DSP COR NID STP UNI OTPa OUR'
Tk: 1
Set-Cookie: _pk_uid=deleted; expires=Mon, 29-Apr-2013 14:51:03 GMT
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: image/gif

Enable debug as per: Tracking HTTP API: API Reference - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3

And try again to open the response, what message is printed?

I already added the


[Tracker]
debug = 1

to the ini file yesterday and so the previous HTTP Response was with that setting enabled. I will check again and do another test shortly and post the Reponse header again.

I checked and the debug is enabled.

I also checked my piwik server logs and I do see the tracking GET request come into my piwik server. So this appears to me now that the Piwik code installed on my piwik server is not processing the request.

Just to clarify when reading my log output:
http://ourspaceonthenet.com/piwik = piwik server
http://foo.bar.com = tracking web site

Here is the query received by my piwik server as shown in the piwik server’s visitor log

http://ourspaceonthenet.com/piwik/piwik.php?action_name=Contact%20-%20Best%20of%20Event%202014%20-%20Web%20Galleries&idsite=1&rec=1&r=204813&h=11&m=13&s=47&url=http%3A%2F%2Ffoo.bar.com%2Fcontact.php&urlref=http%3A%2F%2Ffoo.bar.com%2Fgalleries.php&_id=f3601a9a5b19134d&_idts=1398852823&_idvc=1&_idn=0&_refts=0&_viewts=1398852823&pdf=0&qt=0&realp=0&wma=0&dir=0&fla=1&java=1&gears=0&ag=1&cookie=1&res=1920x1080&gt_ms=2

On the tracker web site I received a HTTP Response of 200 and so it finds the file at the url but I don’t see any information in the Response in Firebug (it’s blank).

To summarise, here’s what I know

The tracking page is sending the HTTP GET request
The Piwik server is receiving the HTTP Get request and acknowledging that with a HTTP 200 response
The Piwik dashboard and visitor log are not reflecting they have received the tracking request
The Piwik database has no entries from the tracking requests received

One last point - I enabled log_level = VERBOSE and then triggered the tracker code on the tracker web site. Nothing gets written to the /piwik/tmp/logs/piwik.log file. I see entries for when I visit the piwik dashboard, but nothing which shows the tracking code being invoked.

At this point I am completely at a loss to understand where the problem resides.

So when you have debug=1 and then you visit this URL


http://ourspaceonthenet.com/piwik/piwik.php?action_name=Contact%20-%20Best%20of%20Event%202014%20-%20Web%20Galleries&idsite=1&rec=1&r=204813&h=11&m=13&s=47&url=http%3A%2F%2Ffoo.bar.com%2Fcontact.php&urlref=http%3A%2F%2Ffoo.bar.com%2Fgalleries.php&_id=f3601a9a5b19134d&_idts=1398852823&_idvc=1&_idn=0&_refts=0&_viewts=1398852823&pdf=0&qt=0&realp=0&wma=0&dir=0&fla=1&java=1&gears=0&ag=1&cookie=1&res=1920x1080&gt_ms=2

what text is displayed in the page?

Interesting.


INFO Piwik\Tracker[2014-05-01 04:56:13] [64557] ---------------------------
INFO Piwik\Tracker[2014-05-01 04:56:13] [64557] INIT
INFO Piwik\Tracker[2014-05-01 04:56:13] [64557] Querying Piwik API at: http://ourspaceonthenet.com/piwik/index.php
INFO Piwik\Tracker[2014-05-01 04:56:13] [64557] Running Piwik 2.1.0 as Super User: dpeuser
INFO Piwik\Tracker[2014-05-01 04:56:21] [64557] ERROR: The Piwik URL http://ourspaceonthenet.com/piwik/index.php does not seem to be pointing to a Piwik server. Response was 'X-Powered-By: PHP/5.3.20P3P: CP='OTI DSP COR NID STP UNI OTPa OUR'Set-Cookie: _pk_uid=deleted; expires=Wed, 01-May-2013 04:56:12 GMTTk: 1Content-Type: image/gifGIF89a€!ù,D;'.

Sorry, ignore the last post as I hadn’t replaced my foo.bar.com URL with the correct one

Just tried again and I get 1x1 pixel image served by piwik.php. The page looks blank.

If you get 1*1 you havent enabled debug as explained in: Tracking HTTP API: API Reference - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3

yes, I have. I have just downloaded the config.ini file and here is the copy and paste from it

; <?php exit; ?> DO NOT REMOVE THIS LINE
; file automatically generated or modified by Piwik; you can manually override the default values in global.ini.php by redefining them in this file.
[database]
host = "127.0.0.1"
username = "ourspace_piwik"
password = "xxxxxxxxxxxxxxxxxxx"
dbname = "ourspace_piwikanalytics"
tables_prefix = "piwik_"
adapter = "PDO\MYSQL"
charset = "utf8"

[Tracker]
debug = 1

[General]
salt = "2f8494f2b71ad985836bd6a8eec7f3c0"
trusted_hosts[] = "ourspaceonthenet.com"
trusted_hosts[] = "foo.bar.com"

[PluginsInstalled]
PluginsInstalled[] = "Login"
PluginsInstalled[] = "CoreAdminHome"
PluginsInstalled[] = "UsersManager"
PluginsInstalled[] = "SitesManager"
PluginsInstalled[] = "Installation"
PluginsInstalled[] = "CorePluginsAdmin"
PluginsInstalled[] = "CoreHome"
PluginsInstalled[] = "CoreVisualizations"
PluginsInstalled[] = "Proxy"
PluginsInstalled[] = "API"
PluginsInstalled[] = "ExamplePlugin"
PluginsInstalled[] = "Widgetize"
PluginsInstalled[] = "Transitions"
PluginsInstalled[] = "LanguagesManager"
PluginsInstalled[] = "Actions"
PluginsInstalled[] = "Dashboard"
PluginsInstalled[] = "MultiSites"
PluginsInstalled[] = "Referrers"
PluginsInstalled[] = "UserSettings"
PluginsInstalled[] = "Goals"
PluginsInstalled[] = "SEO"
PluginsInstalled[] = "Events"
PluginsInstalled[] = "UserCountry"
PluginsInstalled[] = "VisitsSummary"
PluginsInstalled[] = "VisitFrequency"
PluginsInstalled[] = "VisitTime"
PluginsInstalled[] = "VisitorInterest"
PluginsInstalled[] = "ExampleAPI"
PluginsInstalled[] = "ExampleRssWidget"
PluginsInstalled[] = "Provider"
PluginsInstalled[] = "Feedback"
PluginsInstalled[] = "CoreUpdater"
PluginsInstalled[] = "CoreConsole"
PluginsInstalled[] = "ScheduledReports"
PluginsInstalled[] = "UserCountryMap"
PluginsInstalled[] = "Live"
PluginsInstalled[] = "CustomVariables"
PluginsInstalled[] = "PrivacyManager"
PluginsInstalled[] = "ImageGraph"
PluginsInstalled[] = "Annotations"
PluginsInstalled[] = "MobileMessaging"
PluginsInstalled[] = "Overlay"
PluginsInstalled[] = "SegmentEditor"
PluginsInstalled[] = "Morpheus"
PluginsInstalled[] = "Zeitgeist"

[Plugins_Tracker]
Plugins_Tracker[] = "Provider"
Plugins_Tracker[] = "Goals"
Plugins_Tracker[] = "PrivacyManager"
Plugins_Tracker[] = "UserCountry"
Plugins_Tracker[] = "Login"
Plugins_Tracker[] = "UsersManager"
Plugins_Tracker[] = "SitesManager"

[size=large]PROBLEM SOLVED![/size]

I deleted the piwik files, the database and downloaded v2.2. I’ve done a clean install and initial tests show it to be working.

Thanks for the help!