Piwik proxy script doesn`t work
-
I have configured piwik to use proxy, but it looks that it doesn`t work. Could take a look into this, please. Thank You! 🙂
-
Actually the proxy mode works fine, so I need some more information about your configuration and what “does not work” means in fact to get behind your issue.
Is the tracking code not shown? Is the proxy script not accessible? Is the script added as expected, but Piwik does not count? …
Oh, sorry. Code is added on auto. I see it in source, but it doesn`t send any stats to piwik.
And the code is added as expected?
Does YOUR_DOMAIN/wp-content/plugins/wp-piwik/piwik.php show the tracking client code?
Do the other tracking modes work?
Yep:
<!-- Piwik --> <script type="text/javascript"> var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u=(("https:" == document.location.protocol) ? "https" : "http") + "://MYDOMAIN.COM/wp-content/plugins/wp-piwik/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', 2]); 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.php'; s.parentNode.insertBefore(g,s); })(); </script> <!-- End Piwik Code -->
When I navigate to wp-content/plugins/wp-piwik/piwik.php, I see GIF Image 1×1 in center.
I tried Default tracking, but seems, that it doesn`t send data to main PIWIK, I can see that data in WP-PIWIK only.
WP-Piwik just gets the tracking code using Piwik API, does some changes (if necessary) and adds it to your blog. Furthermore, WP-Piwik gets analytics data from Piwik and shows it inside the WordPress dashboard.
WP-Piwik neither tracks by itself nor stores tracking data… if values are shown in WP-Piwik, they have to be available in Piwik, too. Maybe you should check your date settings in Piwik? By default it does not show today’s data.
If you open the proxy PHP script, you should get a JavaScript code, e.g., see
https://www.braekling.de/wp-content/plugins/wp-piwik/piwik.phpOk, I see. I have set Piwik to show today by default.
First tracking option works fine, without any problems, but I need to use piwik.php proxy.
Here is what I see in my browser Tab, when I try to load piwik.php (wp-content/plugins/wp-piwik/piwik.php):
http://oi59.tinypic.com/21o6joj.jpgI tried another thing to check, if this problem is not caused by server:
I uplodaded piwik.php script from developers to root domain, configured it. Then I added javascript code to my page footer with main piwik details and it worked, Piwik shows stats.I am trying to figure out, what`s blocking that connection between your plugin proxy and piwik analytic. All I done, is ticked box to Use proxy script and add javascript to footer. And why when I navigate to piwik.php I see gif… Mystic for me. Maybe I need to edit some permissions through ftp? Any Ideas?
Hm, can you check your .htaccess files in your WordPress folder, your wp-content folder and your wp-content/plugins folder?
Meanwhile, I will check if the piwik.php script may cause this issue on his own (e.g., by delivering a gif header or something similar…).
WordPress htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule># END WordPress
There is none htaccess in plugin folder and wp-content.
Here are the permissions: 0755 for wp-content and plugins. For piwik.php located in wp-piwik folder is 0644.
Can you give me the response header of piwik.php?
If you don’t know how to get it using your browser, try a tool like http://tools.seobook.com/server-header-checker/ – just enter the full URL of piwik.php, click “Check Headers” and copy the result.
Ok, here is the result:
SERVER RESPONSE: HTTP/1.1 200 OK Date: Sun, 22 Jun 2014 15:51:49 GMT Server: LiteSpeed Connection: Keep-Alive Keep-Alive: timeout=5, max=100 X-Powered-By: PHP/5.3.28 Set-Cookie: popover_view_4721c91e4074095d276cfbb7ed556ae5=1; expires=Thu, 04-Jun-2015 21:11:49 GMT; path=/ Cache-Control: public, max-age=604800 Expires: Sun, 29 Jun 2014 15:51:49 GMT Content-Type: image/gif Vary: User-Agent
Ok, thank you. Two more questions: Are you using WP-Piwik in network mode? And are you using the REST or the PHP API?
I am using REST MODE. Could you please explain more about ” Are you using WP-Piwik in network mode? “? Didn`t understand.
Are you using WordPress in network mode (one WordPress setup for many blogs, http://codex.wordpress.org/Create_A_Network ) or are you using just a simple WordPress?
- The topic ‘Piwik proxy script doesn`t work’ is closed to new replies.