• I have a piwik install at https://petermolnar.eu/piwik
    The WP install is set up as:

    Piwik URL (REST API) => "https://petermolnar.eu/piwik/"

    The generated code in WP-Piwik is:

    <!-- Piwik -->
        <script type="text/javascript">
          var _paq = _paq || [];
          _paq.push(['disableCookies']);
        _paq.push(['trackPageView']);
          _paq.push(['enableLinkTracking']);
          (function() {
            var u="//petermolnar.eu/";
            _paq.push(['setTrackerUrl', u+'piwik.php']);
            _paq.push(['setSiteId', 1]);
            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 -->

    While the code in Piwik itself is the following:

    <!-- Piwik -->
        <script type="text/javascript">
          var _paq = _paq || [];
          _paq.push(['trackPageView']);
          _paq.push(['enableLinkTracking']);
          (function() {
            var u="//petermolnar.eu/piwik/";
            _paq.push(['setTrackerUrl', u+'piwik.php']);
            _paq.push(['setSiteId', 1]);
            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.js'; s.parentNode.insertBefore(g,s);
          })();
        </script>
        <noscript><p><img src="//petermolnar.eu/piwik/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
        <!-- End Piwik Code -->

    Check the var u=; line difference.

    https://wordpress.org/plugins/wp-piwik/

Viewing 1 replies (of 1 total)
  • Plugin Author braekling

    (@braekling)

    Please check if a CDN url is defined in your tracking settings (both text boxes should be empty). Also check the trusted domain defined in Piwik itself.

    If everything looks ok, please reset WP-Piwik’s settings (see support tab).

    WP-Piwik works with Piwik in a subdirectory, so the issue should be caused by something else.

Viewing 1 replies (of 1 total)
  • The topic ‘tracking code generation does not respect subdirectories in piwik url’ is closed to new replies.