Forum Replies Created

Viewing 15 replies - 1 through 15 (of 19 total)
  • Thread Starter edou

    (@edou)

    About the subdomain: is it then an option to install a second piwik to match the url?

    about the options for the tracking code: copy paste doesn’t work if you use the wp_footer() as tracking method in wp-piwik, isn’t it?

    Thread Starter edou

    (@edou)

    I just made a test disabling the “trusted domain” and noticed the following:
    where the IPv6 url shows when “trusted domain” enabled (2 and 4), I have domain name “kvdb.nu” when disabled.
    where the IPv4 url (www.kvdb.nu) shows when “trusted domain” enabled (1 and 3), I have domain name “www.kvdb.nu” when disabled.

    I went to the wp-piwik setting and saw that I didn’t use the www. before domain name in piwik url. I made the correction, tested with “trusted domain” disabled, and then enabled it.

    It now works properly.
    So I give you a BIG THANK for your help on that problem.

    I’m wondering what’s going to happen when I want to use a subdomain later on regarding the IPv6 url problem. Is there anything special to do about it to prevent confusion?

    I still have the issue that piwik doesn’t update when I use the tracking code options. But I sense you’ll say I should ask in the piwik forum?

    Thread Starter edou

    (@edou)

    4- the code from the page source (indeed in the header):

    <!-- *** WP-Piwik - see http://ww.wp.xz.cn/extend/plugins/wp-piwik/ ******** -->
    <!-- Piwik -->
    <script type="text/javascript">
      var _paq = _paq || [];
      _paq.push(['trackPageView']);
      _paq.push(['enableLinkTracking']);
      (function() {
        var u=(("https:" == document.location.protocol) ? "https" : "http") + "://2a01:7c8:eb:0:95:170:70:70/statistiek/piwik//";
        _paq.push(['setTrackerUrl', u+'piwik.php']);
        _paq.push(['setSiteId', 2]);
        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
        g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
      })();
    
    </script>
    <noscript><p><img src="http://2a01:7c8:eb:0:95:170:70:70/statistiek/piwik/piwik.php?idsite=2" style="border:0" alt="" /></p></noscript>
    <!-- End Piwik Code -->
    <!-- *** /WP-Piwik *********************************************************** -->

    Thread Starter edou

    (@edou)

    I updated both piwik to 1.11.1 and wp-piwik to 0.9.9.0.
    NB: I noticed since version 1.9 that when I want use the options for the tracking code that nor piwik nor wp-piwik remembers thoses changes.
    With the last test was “trusted domain” enabled
    It seems the IPv6 problem is still there.

    1- Tracking code from Piwik:

    <!-- Piwik -->
    <script type="text/javascript">
      var _paq = _paq || [];
      _paq.push(["trackPageView"]);
      _paq.push(["enableLinkTracking"]);
    
      (function() {
        var u=(("https:" == document.location.protocol) ? "https" : "http") + "://www.kvdb.nu/statistiek/piwik/";
        _paq.push(["setTrackerUrl", u+"piwik.php"]);
        _paq.push(["setSiteId", "2"]);
        var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
        g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
      })();
    </script>
    <!-- End Piwik Code -->

    2- tracking code from wp-piwik:

    <!-- Piwik -->
    <script type="text/javascript">
      var _paq = _paq || [];
      _paq.push(['trackPageView']);
      _paq.push(['enableLinkTracking']);
      (function() {
        var u=(("https:" == document.location.protocol) ? "https" : "http") + "://2a01:7c8:eb:0:95:170:70:70/statistiek/piwik//";
        _paq.push(['setTrackerUrl', u+'piwik.php']);
        _paq.push(['setSiteId', 2]);
        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
        g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
      })();
    
    </script>
    <noscript><p><img src="http://2a01:7c8:eb:0:95:170:70:70/statistiek/piwik/piwik.php?idsite=2" style="border:0" alt="" /></p></noscript>
    <!-- End Piwik Code -->

    3- URL for API test and result:
    http://www.kvdb.nu/statistiek/piwik/index.php?module=API&method=SitesManager.getJavascriptTag&idSite=2&piwikUrl=&format=xml&token_auth=XXXXXXXXXXX

    <!-- Piwik -->
    <script type="text/javascript">
      var _paq = _paq || [];
      _paq.push(['trackPageView']);
      _paq.push(['enableLinkTracking']);
      (function() {
        var u=(("https:" == document.location.protocol) ? "https" : "http") + "://www.kvdb.nu/statistiek/piwik//";
        _paq.push(['setTrackerUrl', u+'piwik.php']);
        _paq.push(['setSiteId', 2]);
        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
        g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
      })();
    
    </script>
    <noscript><p><img src="http://www.kvdb.nu/statistiek/piwik/piwik.php?idsite=2" style="border:0" alt="" /></p></noscript>
    <!-- End Piwik Code -->

    Thread Starter edou

    (@edou)

    I’m using Piwik 1.11 and WP-Piwik 0.9.8.1

    1- ok, site 2
    2- done
    3-

    <!-- Piwik -->
    <script type="text/javascript">
      var _paq = _paq || [];
      _paq.push(['trackPageView']);
      _paq.push(['enableLinkTracking']);
      (function() {
        var u=(("https:" == document.location.protocol) ? "https" : "http") + "://2a01:7c8:eb:0:95:170:70:70/statistiek/piwik//";
        _paq.push(['setTrackerUrl', u+'piwik.php']);
        _paq.push(['setSiteId', 2]);
        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
        g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
      })();
    
    </script>
    <noscript><p><img src="http://2a01:7c8:eb:0:95:170:70:70/statistiek/piwik/piwik.php?idsite=2" style="border:0" alt="" /></p></noscript>
    <!-- End Piwik Code -->

    4-

    <!-- *** WP-Piwik - see http://www.braekling.de/wp-piwik-wpmu-piwik-wordpress/ -->
    <!-- Piwik -->
    <script type="text/javascript">
      var _paq = _paq || [];
      _paq.push(['trackPageView']);
      _paq.push(['enableLinkTracking']);
      (function() {
        var u=(("https:" == document.location.protocol) ? "https" : "http") + "://2a01:7c8:eb:0:95:170:70:70/statistiek/piwik//";
        _paq.push(['setTrackerUrl', u+'piwik.php']);
        _paq.push(['setSiteId', 2]);
        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
        g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
      })();
    
    </script>
    <noscript><p><img src="http://2a01:7c8:eb:0:95:170:70:70/statistiek/piwik/piwik.php?idsite=2" style="border:0" alt="" /></p></noscript>
    <!-- End Piwik Code -->
    <!-- *** /WP-Piwik *********************************************************** -->

    5-`<!– Piwik –>
    <script type=”text/javascript”>
    var _paq = _paq || [];
    _paq.push([‘trackPageView’]);
    _paq.push([‘enableLinkTracking’]);
    (function() {
    var u=((“https:” == document.location.protocol) ? “https” : “http”) + “://www.kvdb.nu/statistiek/piwik//”;
    _paq.push([‘setTrackerUrl’, u+’piwik.php’]);
    _paq.push([‘setSiteId’, 2]);
    var d=document, g=d.createElement(‘script’), s=d.getElementsByTagName(‘script’)[0]; g.type=’text/javascript’;
    g.defer=true; g.async=true; g.src=u+’piwik.js’; s.parentNode.insertBefore(g,s);
    })();

    </script>
    <noscript><p><img src=”http://www.kvdb.nu/statistiek/piwik/piwik.php?idsite=2&#8243; style=”border:0″ alt=”” /></p></noscript>
    <!– End Piwik Code –>
    `

    Thread Starter edou

    (@edou)

    Ok, I’m going to do that on the subfolder site where I’m busy building content (site 2).
    I’ll forget the subdomain (site 3) since I have to start it from scratch for different reasons. And site 1 is not a WP site, just the index of the root folder on the server.

    Thread Starter edou

    (@edou)

    I must specify that the trusted hostname is still disabled

    Thread Starter edou

    (@edou)

    Just to check, I replaced PIWIK_URL by my site url followed by the path to the piwik folder, SITE_ID with 2 and AUTH_TOKEN with the provided by piwik for site 2. Nothing more.

    I got this result, with no ipv6:

    This XML file does not appear to have any style information associated with it. The document tree is shown below.
    <result><!– Piwik –>
    <script type=”text/javascript”>
    var _paq = _paq || [];
    _paq.push([‘trackPageView’]);
    _paq.push([‘enableLinkTracking’]);
    (function() {
    var u=((“https:” == document.location.protocol) ? “https” : “http”) + “://www.kvdb.nu/statistiek/piwik//”;
    _paq.push([‘setTrackerUrl’, u+’piwik.php’]);
    _paq.push([‘setSiteId’, 2]);
    var d=document, g=d.createElement(‘script’), s=d.getElementsByTagName(‘script’)[0]; g.type=’text/javascript’;
    g.defer=true; g.async=true; g.src=u+’piwik.js’; s.parentNode.insertBefore(g,s);
    })();

    </script>
    <noscript><p><img src=”http://www.kvdb.nu/statistiek/piwik/piwik.php?idsite=2&#8243; style=”border:0″ alt=”” /></p></noscript>
    <!– End Piwik Code –>
    </result>

    Thread Starter edou

    (@edou)

    i just did disable it, and it immediately started to track when I called the site.
    Is there anything else to do to solve that problem?

    Thread Starter edou

    (@edou)

    I’ve had a look to the post.
    So far, I noticed that my trusted hostanem was http://www.kvdb.nu. Should it be something else regarding the fact that the piwik folder is stored in a subfolder?
    I gave it a try by changing it to http://www.kvdb.nu/thepath, and within no time I had a bunch of error messages.

    Thread Starter edou

    (@edou)

    I’m going to have a look to the thread. I’ll let you know.

    The last code generated by wp-piwik doesn’t work when hard coded.
    when i activate the use of wp_footer(), the source of the page shows the following one:

    [ Moderator Note: Really please post code or markup snippets between backticks or use the code button. ]

    <!-- *** WP-Piwik - see http://www.braekling.de/wp-piwik-wpmu-piwik-wordpress/ -->
    <!-- Piwik -->
    <script type="text/javascript">
      var _paq = _paq || [];
      _paq.push(['trackPageView']);
      _paq.push(['enableLinkTracking']);
      (function() {
        var u=(("https:" == document.location.protocol) ? "https" : "http") + "://2a01:7c8:eb:0:95:170:70:70/statistiek/piwik//";
        _paq.push(['setTrackerUrl', u+'piwik.php']);
        _paq.push(['setSiteId', 2]);
        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
        g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
      })();
    
    </script>
    <noscript><p><img src="http://2a01:7c8:eb:0:95:170:70:70/statistiek/piwik/piwik.php?idsite=2" style="border:0" alt="" /></p></noscript>
    <!-- End Piwik Code -->
    Thread Starter edou

    (@edou)

    for 1 and 3, I got the code from piwik site directly, and hard coded it.
    for site 2, i got it from piwik interface.
    The one generated in wp-piwik would be the following:

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    <!-- Piwik -->
    <script type="text/javascript">
      var _paq = _paq || [];
      _paq.push(['trackPageView']);
      _paq.push(['enableLinkTracking']);
      (function() {
        var u=(("https:" == document.location.protocol) ? "https" : "http") + "://2a01:7c8:eb:0:95:170:70:70/statistiek/piwik//";
        _paq.push(['setTrackerUrl', u+'piwik.php']);
        _paq.push(['setSiteId', 2]);
        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
        g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
      })();
    
    </script>
    <noscript><p><img src="http://2a01:7c8:eb:0:95:170:70:70/statistiek/piwik/piwik.php?idsite=2" style="border:0" alt="" /></p></noscript>
    <!-- End Piwik Code -->
    Thread Starter edou

    (@edou)

    For site 1 (maindomain):

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    <!-- Piwik -->
    <script type="text/javascript">
    var pkBaseURL = (("https:" == document.location.protocol) ? "https://www.kvdb.nu/statistiek/piwik/" : "http://www.kvdb.nu/statistiek/piwik/");
    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", 1);
    piwikTracker.trackPageView();
    piwikTracker.enableLinkTracking();
    } catch( err ) {}
    </script><noscript><p><img src="http://www.kvdb.nu/statistiek/piwik/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
    <!-- End Piwik Tracking Code -->
    
    For site 3 (subdomain):
    <!-- Piwik -->
    <script type="text/javascript">
    var pkBaseURL = (("https:" == document.location.protocol) ? "https://www.kvdb.nu/statistiek/piwik/" : "http://www.kvdb.nu/statistiek/piwik/");
    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", 3);
    piwikTracker.trackPageView();
    piwikTracker.enableLinkTracking();
    } catch( err ) {}
    </script><noscript><p><img src="http://www.kvdb.nu/statistiek/piwik/piwik.php?idsite=3" style="border:0" alt="" /></p></noscript>
    <!-- End Piwik Tracking Code -->
    
    I just made a try on site 2 (subfolder of maindomain) pasting the code generated by piwik and that wp-piwik could see, but that doesn't work, apparently also not when hard coded:
    
    <!-- Piwik -->
    <script type="text/javascript">
      var _paq = _paq || [];
      _paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
      _paq.push(["setCookieDomain", "*.kvdb.nu"]);
      _paq.push(["setDomains", ["*.kvdb.nu"]]);
      _paq.push(["trackPageView"]);
      _paq.push(["enableLinkTracking"]);
    
      (function() {
        var u=(("https:" == document.location.protocol) ? "https" : "http") + "://www.kvdb.nu/";
        _paq.push(["setTrackerUrl", u+"piwik.php"]);
        _paq.push(["setSiteId", "2"]);
        var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
        g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
      })();
    </script>
    <noscript><p><img src="http://www.kvdb.nu/statistiek/piwik/piwik.php?idsite=2" style="border:0" alt="" /></p></noscript>
    Thread Starter edou

    (@edou)

    Hi, thx for your answer.
    I don’t really know how to determine whether wp-piwik or piwik a problem is.
    To give it a try last night, I hard coded in site 3 the same tracking code than site 1 (specifying site3 naturally). And then it records visits.
    What I can see, is that if I tell wp-piwik to use wp_footer(), there is no cookie set to the browser. So it makes sense that no record is registered. Why that part doesn’t work, I don’t know.
    Would that mean that piwik doesn’t work properly?

    You can my post hier: http://ww.wp.xz.cn/support/topic/tracking-works-only-with-hard-coding?replies=1

    Thread Starter edou

    (@edou)

    yes, I guessed so, and ask myself why the hell “/sites” is present there, and where I could change that. I did’nt find it ine the code, nor in the database.

Viewing 15 replies - 1 through 15 (of 19 total)