• Resolved ripencc

    (@ripencc)


    Hello,

    We are using WP-Piwik on several WordPress sites, and recently noticed the stats had stopped completely.

    Investigating, it turns out that after the last update (0.9.8), WP-Piwik now generates tracking code that has the host IPv6 address instead of the HOSTNAME. Piwik itself has no problem with this, it generates proper code. We found no way of fixing this in the settings.

    The problem comes up likely because the host has both IPv4 and IPv6 addresses, but no IPv6 reverse (which likely would have hidden it). But it causes problems since it bypasses all VHost configuration now.

    Problem tracking code:

    <!– Piwik –>
    <script type=”text/javascript”>
    var pkBaseURL = ((“https:” == document.location.protocol) ? “https://2001:67c:2e8:xxxxxx/piwik/&#8221; : “https://2001:67c:2e8:xxxxxxxxx/piwik/&#8221;);
    document.write(unescape(“%3Cscript src='” + pkBaseURL + “piwik.js’ type=’text/javascript’%3E%3C/script%3E”));
    </script><script type=”text/javascript”>
    try {
    var piwikTracker = Piwik.getTracker(pkBaseURL + “piwik.php”, 8);
    piwikTracker.trackPageView();
    piwikTracker.enableLinkTracking();
    } catch( err ) {}
    </script><noscript><p><img src=”https://2001:67c:2e8:xxxxxxxx/piwik/piwik.php?idsite=8&#8243; style=”border:0″ alt=”” /></p></noscript>
    <!– End Piwik Tracking Code –>

    Please advise.

    Thank you,
    Mihnea

    https://www.ads-software.com/extend/plugins/wp-piwik/

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

    (@braekling)

    WP-Piwik gets its tracking code from Piwik itself.

    Maybe the trusted hostname is not configured properly?
    See https://piwik.org/faq/troubleshooting/#faq_171
    and https://www.ads-software.com/support/topic/wp-piwik-changes-link-to-ip?replies=14

    Thread Starter ripencc

    (@ripencc)

    Piwik was correctly configured (and the code was correct there), however within WP-Piwik we were using an alias of the Piwik server to talk to it — i.e. “machine.example.com” instead of “piwik.example.com”. This used to work correctly until recently, but it is possible more stringent security controls now restrict the behaviour.

    Changing the hostname to the “canonical” one (piwik.example.com) used within Piwik fixed the issue. It is still weird that the IPv6 address was showing up there, it may warrant some investigation (a hostname error instead of that behaviour would probably push people in the right direction).

    Thanks,
    Mihnea

    Plugin Author braekling

    (@braekling)

    Nice to hear that it’s working now!

    This issue is caused by Piwik itself – WP-Piwik gets a tracking code and
    no error message, so WP-Piwik supposes the tracking code is valid. If you don’t use the API (like WP-Piwik) but open machine.example.com (instead of piwik.example.com) directly using your browser, you can see a hostname error message returned by Piwik.

    Btw: You can disable the trusted hostname feature if you need to use the alias. Or you can use the Piwik proxy skript to hide the “canonical” hostname (be careful: in this case disabling cookies won’t work anymore). See the Piwik documentation or FAQ regarding these topics.

    Thread Starter ripencc

    (@ripencc)

    Thanks for the extra information, indeed disabling the trusted hostname feature seems like the best bet. For now we just changed all websites to point to the canonical name, if we ever have a need to change that we’ll just disable the “trusted hostname”.

    Regards,
    Mihnea

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Tracking code has bare IPv6 address’ is closed to new replies.