WordPress.org

Ready to get started?Download WordPress

Forums

WP-Piwik
[resolved] WP-Piwik changes link to IP (16 posts)

  1. campino2k
    Member
    Posted 1 year ago #

    Instead of the link to (configured) Piwik installation, WP-Piwik changes the domain to the regarding IP (which does not work, since tehre are multiple domains and the IP does not serve a site.

    http://wordpress.org/extend/plugins/wp-piwik/

  2. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. campino2k
    Member
    Posted 1 year ago #

    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.

  4. campino2k
    Member
    Posted 1 year ago #

    BTW: This is new with the lastest version.

  5. campino2k
    Member
    Posted 1 year ago #

    Piwik itself does generate the correct tracking code.

  6. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    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?

  7. campino2k
    Member
    Posted 1 year ago #

    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)

  8. campino2k
    Member
    Posted 1 year ago #

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

  9. campino2k
    Member
    Posted 1 year ago #

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

  10. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    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?

  11. campino2k
    Member
    Posted 1 year ago #

    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.

  12. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  13. campino2k
    Member
    Posted 1 year ago #

    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!

  14. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    Alright, and yes - I will do so!

    Best regards
    André

  15. larsemil
    Member
    Posted 11 months ago #

    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.

  16. larsemil
    Member
    Posted 11 months ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.