WordPress.org

Forums

WP-Piwik
[resolved] js/index code not generated in footer (15 posts)

  1. interfaSys
    Member
    Posted 2 years ago #

    The tracking code preview shows the code which supports /js/index.php, but that code never makes it to the footer which only contains the standard code.

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

  2. braekling
    Member
    Plugin Author

    Posted 2 years ago #

    Are you using a cache plugin? Maybe it will help to clear your cache.

    Please also keep sure the tracking code is added by wp_footer() in your footer.php (i.e. not inserted manually before).

  3. interfaSys
    Member
    Posted 2 years ago #

    I thought it was the cache, but I've tested on a site without any caching system and I see the same problem. Enabling/disabling the code works, but not the switch to enable/disable "/js".

  4. braekling
    Member
    Plugin Author

    Posted 2 years ago #

    Hmmm... looks fine here:

    <!-- *** WP-Piwik - see http://www.braekling.de/wp-piwik-wpmu-piwik-wordpress/ -->
    <!-- Piwik -->
    <script type="text/javascript">
    var pkBaseURL = (("https:" == document.location.protocol) ? "https://braekling.de/statserver/" : "http://braekling.de/statserver/");
    document.write(unescape("%3Cscript src='" + pkBaseURL + "js/' type='text/javascript'%3E%3C/script%3E"));
    </script><script type="text/javascript">
    try {
      var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
      piwikTracker.setRequestMethod('POST');
      piwikTracker.disableCookies();
    piwikTracker.trackPageView();
      piwikTracker.enableLinkTracking();
    } catch( err ) {}
    </script><noscript><p><img src="http://braekling.de/statserver/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
    <!-- End Piwik Tracking Code -->
    <!-- *** /WP-Piwik *********************************************************** -->

    Can you post a screenshot of your tracking settings, please?
    Are you using WP-Piwik in network mode or as a simple blog's plugin?

  5. interfaSys
    Member
    Posted 2 years ago #

    Since this forum doesn't support pictures, I'll just post the options which have been ticked:

    • Add tracking code
    • Use js/index.php
    • Avoid mod_security
    • Tracking filter: Administrator

    I'm using the plugin in "simple blog" mode, on a network.

  6. braekling
    Member
    Plugin Author

    Posted 2 years ago #

    You can post pictures by posting a link, e.g. to an upload service like MediaFire. Anyway... I tried your settings here but the plugin is still working fine.

    This evening I'll set up a test environment to try your base configuration ("simple blog" on a network). Maybe so I can get behind this issue.

  7. braekling
    Member
    Plugin Author

    Posted 2 years ago #

    I'm currently at loss with this. Everything is fine in my test environment, too.

    Can you tell me your blog's URL so I can have a look at the inserted tracking code?

  8. interfaSys
    Member
    Posted 2 years ago #

    I have to apologize... I've just checked again and the switch is working. I did restart Apache though, so maybe something was stuck, but it's definitely working now.

    Thank you for your time.

  9. interfaSys
    Member
    Posted 2 years ago #

    Well, I've just tested again and it doesn't always work. Something is preventing the plugin from writing to the database.

    If I disable that setting, it works, but if I try to re-enable it, it doesn't. If I go to "settings" and come back to "tracking", then it's switched back on.

  10. interfaSys
    Member
    Posted 2 years ago #

    And there are no errors in the logs, just warnings:

    [Mon Oct 22 23:27:06.460999 2012] [:error] [pid 61751] [client 1.2.3.4:54469] PHP Warning:  Creating default object from empty value in /wp-admin/includes/update.php on line 90, referer: https://www.domain.com/wp-admin/options-general.php?page=wp-piwik/wp-piwik.php&tab=tracking
    [Mon Oct 22 23:27:06.476263 2012] [:error] [pid 61751] [client 1.2.3.4:54469] PHP Warning:  strpos(): Empty delimiter in /wp-content/plugins/wordpress-https/lib/WordPressHTTPS/Module/Parser.php on line 88, referer: https://www.domain.com/wp-admin/options-general.php?page=wp-piwik/wp-piwik.php&tab=tracking

    And we're running mod_sec by the way, but all the scores are below the threshold.

  11. braekling
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for posting the warnings, I'll have a look at my code again. Maybe this option's handling differs in a detail from the others.

  12. braekling
    Member
    Plugin Author

    Posted 2 years ago #

    I still was not able to reconstruct this issue. Maybe it regards to this one: http://wordpress.org/support/topic/after-upgrade-piwik-automatically-places-cookies-again?replies=6 Please try again in 0.9.7.

  13. tbarthelet
    Member
    Posted 2 years ago #

    Hi and thanks for the plugin!

    I've been using js/index.php option and it works well but only partially.

    According to http://demo.piwik.org/js/README

    * If you are concerned about the impact of browser-based privacy filters which
    attempt to block tracking, you can change your tracking code to use "js/"
    instead of "piwik.js" and "piwik.php", respectively.

    However, in your code it only replaces piwik.js and not piwik.php...

  14. braekling
    Member
    Plugin Author

    Posted 2 years ago #

    Hi tbarthelet,

    thank you for this information. I'll have a look at this and add an option to replace piwik.php, too.

  15. braekling
    Member
    Plugin Author

    Posted 2 years ago #

    The current development version also replaces piwik.php. The fix will be part of 0.9.8.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP-Piwik
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags