Support » Plugin: WP-Piwik » WP-Piwik changes link to IP

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author braekling


    I’m sorry, but WP-Piwik does not change your configured URL. If at all it adds a slash to your URL:

    self::$aryGlobalSettings['piwik_url'] = self::checkURL((isset($_POST['wp-piwik_url'])?$_POST['wp-piwik_url']:''));
    (Get your entered URL.)

    static function checkURL($strURL) {
    	if (empty($strURL)) return '';
    	if (substr($strURL, -1, 1) != '/' && substr($strURL, -10, 10) != '/index.php')
    		$strURL .= '/';
    	return $strURL;

    (Add a slash if necessary.)

    That’s all.

    Could you please describe your problem in more detail? Maybe I missunderstand your concern.

    Configured is (in my case)

    The tracking code renders

    var pkBaseURL = (("https:" == document.location.protocol) ? "" : "");

    This happens for my other site using WP-Piwik as well.

    But the rendered BaseURL has no Piwik-Subdirectory since there is no page.

    BTW: This is new with the lastest version.

    Piwik itself does generate the correct tracking code.

    Plugin Author braekling


    Can you try to open this link using your browser? (Replace YOUR_PIWIK_PATH, YOUR_SITE_ID, YOUR_AUTH_TOKEN)


    Are you using the REST or the PHP API?

    Uh. Dammit.

    I’m using REST and the link returns the wrong code. Thanks.

    (I checked the code generated by piwik in the admin interface)

    This seems to be exactly what you filed in

    Setting the “piwikUrl” parameter to “YOUR_PIWIK_PATH” helps around this, could you implement this? (tested with the link you provided)

    Plugin Author braekling


    Hm, the PHP API should set this parameter to your configured URL already:

    $strParams .= '&piwikUrl='.urlencode(self::$aryGlobalSettings['piwik_url']);

    You configured the Piwik URL and the Piwik path in WP-Piwik’s settings, didn’t you?

    No. I’m using the REST-Api, thus the PHP-Api-Field is wether shown nor filled.

    “Piwik URL (REST API):” Field contains the (working) path to piwik.

    Plugin Author braekling


    Sorry, my fault.

    But if you are using the REST API, Piwik should be able to estimate its URL by itself. After opening your configured URL you posted above I get this error message:

    Warnung: You are now accessing Piwik from http://CONFIGURED_URL_WP-PIWIK/piwik/, but Piwik has been configured to run at this address: http://CONIFGURED_URL_PIWIK/piwik/.

    The Piwik URL you configured in WP-Piwik corresponds not to the Piwik URL configured in Piwik itself. I suppose Piwik is not able to estimate its own URL by this reason. Please check this.

    Nevertheless I’ll keep in mind to add an “piwikUrl” parameter option to WP-Piwik.

    That seems to be an security feature introduced in the new Piwik Version. (and enabled by default….)

    Since I have the configured a central place where piwik lives on my server and use different domains with aliases to get the script.

    My problem is solved, but please do add this option!

    Plugin Author braekling


    Alright, and yes – I will do so!

    Best regards

    This is still the issue. The code generated has the ip instead of the URI. I cant find any way to change this from within the plugin so I have to disable to enter the code and then I manually insert the code into the footer in the theme.

    Latest version of all things involved.

    Solved it.
    Actually if i entered i got IP instead of URI.
    Entering everything worked just fine.

    The latter being the URI piwik is configured as “its” URI.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘WP-Piwik changes link to IP’ is closed to new replies.