Support » Plugin: Connect Matomo (WP-Matomo, WP-Piwik) » Multiple Piwik Trackers in Piwik 2.3

  • I refer to this change in the 2.3 version of Piwik relating to tracking data from a website in multiple versions of Piwik.

    ​http://developer.piwik.org/api-reference/tracking-javascript#multiple-piwik-trackers

    I want to ask if you have plans to incorporate this change into the wp-piwik plugin? If not, how do you recommend applying this change to my websites in the meantime? i.e. should I stop using wp-piwik and hard code the script into my websites or continue using wp-piwik and apply the code manually in another way?

    thanks for your advice.

    Paul

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

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

    (@braekling)

    This feature is not planned for WP-Piwik yet. But it is planned to allow individual tracking codes defined by the admin.

    Meanwhile: You can still use WP-Piwik, but should disable its “Add tracking code” feature and add your own tracking code to your site manually.

    Out of curiosity: Why do you want to use different Piwik trackers for your site? This will also cause a javascript overload, won’t it?

    Thread Starter closed account

    (@member11)

    thanks for the reply.
    I’m wanting multiple trackers because I have a number of site networks I want to track both individually as well as globally from a management perspective.
    As for the javascript overload, I wasn’t aware this would happen. I guess I’ll just have to test once I’m able to set it up.

    thanks for your help

    Thread Starter closed account

    (@member11)

    How/where is the best place to “add your own tracking code to your site manually” if I disable WP-Piwik “Add tracking code” feature.

    thanks

    Plugin Author braekling

    (@braekling)

    Just open your theme’s header file and add it there.

    Thread Starter closed account

    (@member11)

    thanks for your help.

    Piwik.org provides this code as an example for multiple trackers, but I can’t seem to get it to work. Do I need to be adding more?

    <script type="text/javascript">
    
    window.piwikAsyncInit = function () {
        try {
            var piwikTracker = Piwik.getTracker("http://subdomain.URL_1/", 1);
            piwikTracker.trackPageView();
            var piwik2 = Piwik.getTracker("http://subdomain.URL_2/", 4);
            piwik2.trackPageView();
        } catch( err ) {}
    };
    
    </script>

    I understand this falls outside of plugin support for you, but thought perhaps you could point me in the right direction.

    thanks

    Plugin Author braekling

    (@braekling)

    Did you load piwik.js? You have to load the piwik.js file before you call the trackers.

    Maybe this will help: http://my.safaribooksonline.com/book/-/9781849518482/3dot-tracking-visitors-with-piwik/id286762333

    Otherwise try to ask the Piwik community at http://piwik.org

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Multiple Piwik Trackers in Piwik 2.3’ is closed to new replies.