Title: Piwik PHP Proxy Script Mode Doesn&#039;t Work?
Last modified: August 22, 2016

---

# Piwik PHP Proxy Script Mode Doesn't Work?

 *  Resolved [spiritfly](https://wordpress.org/support/users/spiritfly/)
 * (@spiritfly)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/piwik-php-proxy-script-mode-doesnt-work/)
 * When I choose to track in proxy mode with piwik.php I get the following code:
 *     ```
       <!-- Piwik -->
       <script type="text/javascript">
         var _paq = _paq || [];
         _paq.push(['trackPageView']);
         _paq.push(['enableLinkTracking']);
         (function() {
           var u="//PIWIKDOMAIN/";
           _paq.push(['setTrackerUrl', u+'piwik.php']);
           _paq.push(['setSiteId', 5]);
           var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
           g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.php'; s.parentNode.insertBefore(g,s);
         })();
       </script>
       <!-- End Piwik Code -->
       ```
   
 * So the original piwik server url is revealed in the tracking code which is automatically
   generated.
 * What can I do to avoid this?
 * [https://wordpress.org/plugins/wp-piwik/](https://wordpress.org/plugins/wp-piwik/)

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Author [braekling](https://wordpress.org/support/users/braekling/)
 * (@braekling)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/piwik-php-proxy-script-mode-doesnt-work/#post-5439625)
 * Hmm… here it works fine:
 * > var u=((“https:” == document.location.protocol) ? “https” : “http”) + “://www.
   > braekling.de/wp-content/plugins/wp-piwik/”;
 * Can you give some detail information about your configuration?
 *  Thread Starter [spiritfly](https://wordpress.org/support/users/spiritfly/)
 * (@spiritfly)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/piwik-php-proxy-script-mode-doesnt-work/#post-5439691)
 * I have piwik installed on piwik.domain1.com
    Wordpress installed on domain2.com
   Piwik is latest version: 2.8.3 Wordpress is 4.0
 * I have installed WP-Piwik on WP on domain2.com. I’ve entered the piwik address
   and Auth token in WP-Piwik Settings and it automatically added my blog to piwik
   successfully. I then went into tracking tab and activated it. I chose “use proxy
   script”. And in the line in the code used for tracking where the domain is shown
   says:
 * var u=”//piwik.domain1.com/”;
 * instead of:
 * var u=”//domain2.com/wp-content/plugins/wp-piwik/”;
 * as in your example.
 * So whatever option I choose (Default tracking, Use js/index.php and Use proxy
   script) the domain(u=””) stays the same. I’ve never seen the plugin working in“
   Use proxy script” mode as it should, but having used the proxy script file myself
   outside wordpress, I suppose the url should change to //domain2.com/wp-content/
   plugins/wp-piwik/ such as in your example, because otherwise it defeats the purpose
   of using a proxy script.
 * I really have no clue why this is happening. I’ve installed the plugin on like
   10 different wordpress sites accross 3 totally different hosts and they all share
   the same issue.
 * I solved it temporarily by disabling the tracking in WP-Piwik, and installing
   a new plugin for inserting a Tracking Code in wordpress. Then I entered in there
   the same tracking code that WP-Piwik generated for the proxy script only with
   a modified url:
 * //domain2.com/wp-content/plugins/wp-piwik/
 * Works as expected, but I would really like to use WP-Piwik as it is supposed 
   to.
 *  [djbit](https://wordpress.org/support/users/djbit/)
 * (@djbit)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/piwik-php-proxy-script-mode-doesnt-work/#post-5439724)
 * hmm …
 * I installed a new blog and indeed “Use proxy script” does not work.
    On my old
   blog it worked, so I went to see if there are any other settings. Interestingly
   after clicking on the “Tracking” code on the old blog has changed to normal.
 * Something is wrong with the plug, and exactly clicking a bookmark “Tracking” 
   to change the code.
 * Can no longer change the code on the proxy.
 * How to solve it?
 *  [djbit](https://wordpress.org/support/users/djbit/)
 * (@djbit)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/piwik-php-proxy-script-mode-doesnt-work/#post-5439725)
 * hmmmm I installed a lot older version 0.9.8.1, and it does not work.
 * What’s going on?
 * Not long ago, the option “Use proxy script” to work without a problem.
 *  Thread Starter [spiritfly](https://wordpress.org/support/users/spiritfly/)
 * (@spiritfly)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/piwik-php-proxy-script-mode-doesnt-work/#post-5439727)
 * Just install a plugin called Tracking Code from the repository and put your tracking
   code as you wish to appear in there and disable the tracking in WP-Piwik. Just
   like I did. If it’s critical to you not to reveal your piwik url at any given
   point, you better not rely on dynamically generated tracking code like this script
   does. Even if you fix it now, It may give out your url again with some future
   update so you better not rely on it.
 * Just my 2 cents.
 *  [djbit](https://wordpress.org/support/users/djbit/)
 * (@djbit)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/piwik-php-proxy-script-mode-doesnt-work/#post-5439728)
 * Thanks, I’ll do the same
 *  Plugin Author [braekling](https://wordpress.org/support/users/braekling/)
 * (@braekling)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/piwik-php-proxy-script-mode-doesnt-work/#post-5439781)
 * Does this help?
    [https://wordpress.org/support/topic/proxy-script?replies=1](https://wordpress.org/support/topic/proxy-script?replies=1)
 *  [tareqtms](https://wordpress.org/support/users/tareqtms/)
 * (@tareqtms)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/piwik-php-proxy-script-mode-doesnt-work/#post-5439784)
 * I am having the same problem and the solution in your link doesn’t solve it.
 *  Plugin Author [braekling](https://wordpress.org/support/users/braekling/)
 * (@braekling)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/piwik-php-proxy-script-mode-doesnt-work/#post-5439785)
 * [@tareqtms](https://wordpress.org/support/users/tareqtms/): Can you post your
   invalid tracking code, please?
 * I will provide an intermediate release (0.9.9.13) very soon to fix some urgent
   bugs before 1.0 beta will be released.
 *  [tareqtms](https://wordpress.org/support/users/tareqtms/)
 * (@tareqtms)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/piwik-php-proxy-script-mode-doesnt-work/#post-5439786)
 * Sorry that I couldn’t inform you before. The solution given in the above link
   worked after I re-saved the plugin settings.
 * So, pls include that solution in your new release.
 *  Plugin Author [braekling](https://wordpress.org/support/users/braekling/)
 * (@braekling)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/piwik-php-proxy-script-mode-doesnt-work/#post-5439790)
 * Fixed in 0.9.9.13, release today.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Piwik PHP Proxy Script Mode Doesn't Work?’ is closed to new replies.

 * ![](https://ps.w.org/wp-piwik/assets/icon-256x256.png?rev=3529668)
 * [Connect Matomo - Analytics Dashboard for WordPress](https://wordpress.org/plugins/wp-piwik/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-piwik/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-piwik/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-piwik/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-piwik/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-piwik/reviews/)

 * 11 replies
 * 4 participants
 * Last reply from: [braekling](https://wordpress.org/support/users/braekling/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/piwik-php-proxy-script-mode-doesnt-work/#post-5439790)
 * Status: resolved