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

    (@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.

    Thread Starter campino2k

    (@campino2k)

    Configured is (in my case) http://relevanzgenerator.de/piwik/

    The tracking code renders

    var pkBaseURL = (("https:" == document.location.protocol) ? "https://46.4.223.155/piwik/" : "http://46.4.223.155/piwik/");

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

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

    Thread Starter campino2k

    (@campino2k)

    BTW: This is new with the lastest version.

    Thread Starter campino2k

    (@campino2k)

    Piwik itself does generate the correct tracking code.

    Plugin Author braekling

    (@braekling)

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

    http://YOUR_PIWIK_PATH/index.php?module=API&method=SitesManager.getJavascriptTag&idSite=YOUR_SITE_ID&piwikUrl=&format=xml&token_auth=YOUR_AUTH_TOKEN

    Are you using the REST or the PHP API?

    Thread Starter campino2k

    (@campino2k)

    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)

    Thread Starter campino2k

    (@campino2k)

    This seems to be exactly what you filed in http://dev.piwik.org/trac/ticket/3220

    Thread Starter campino2k

    (@campino2k)

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

    Plugin Author braekling

    (@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?

    Thread Starter campino2k

    (@campino2k)

    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

    (@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.

    Thread Starter campino2k

    (@campino2k)

    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

    (@braekling)

    Alright, and yes – I will do so!

    Best regards
    André

    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 http://dalnix.se/piwik i got IP instead of URI.
    Entering http://www.dalnix.se/piwik 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.