How To: Piwik and NodeBB


  • Admin

    @hmj What other plugins do you have installed? Could be one of them are hammering some routes 😦



  • @julian Not sure here is a list of the plugins we are using.

    Activated plugins:
    nodebb-plugin-composer-default
    nodebb-plugin-dbsearch
    nodebb-plugin-emoji-extended
    nodebb-plugin-emoji-one
    nodebb-plugin-markdown
    nodebb-plugin-mentions
    nodebb-plugin-spam-be-gone
    nodebb-plugin-sso-oauth
    nodebb-widget-essentials

    So I've added GA to the mix. I did that with adding it in the same custom header as to validate that my Piwik installation is not on the fritz. Comparing the two I see a little fewer unique visits between the two in piwik but almost exactly the same amount of pageviews.

    Nodebb is still off by a factor of three in unique visits and around a factor of three to ten in pageviews.



  • Did this piwik code break for anyone else on the 1.6 upgrade?

    0_1508334234807_0f84cd27-16b4-442e-b972-e769f9d14e01.png

    Index 86: $(window).on('action:ajaxify.contentLoaded', function(ev, data) {
    Index 89: })();


  • Admin

    @hmj v1.6.1? or v1.6.0... it may be that the piwik plugin needs updating.

    Edit: Actually, doesn't seem like there is a piwik plugin... are you just putting it in the custom HTML page?



  • @julian Yeah that code at top is put into Appearance -> Custom HTML & CSS -> Custom Header. That had worked fine until the last upgrade.


  • Admin

    @hmj Are you on the develop branch? The code should still work fine in master.

    Also can you please paste the code here?



  • @julian We are on 1.6.0 and not Develop.

    Our code is almost a carbon copy of the one above in the first post.

     <!-- Piwik -->
    <script type="text/javascript">
    var _paq = _paq || [];
    (function () {
        var u = "https://our.piwik.com/";
    
        function firePiwik (data) {
            if (app && app.user && app.user.uid > 0) {
                _paq.push(['setUserId', app.user.uid.toString()]);
                _paq.push(['setCustomVariable', 1, "appUserUsername", app.user.username, "visit"]);
            }
            _paq.push(['setDocumentTitle', document.title]);
            _paq.push(['setCustomUrl', location.href]);
            _paq.push(['enableHeartBeatTimer']);
            _paq.push(['appendToTrackingUrl', 'bots=1']);
    		if (data.tpl === 'search') {
    			_paq.push(['trackSiteSearch', ajaxify.data.search_query,, ajaxify.data.matchCount]);
    		} else {
    			_paq.push(['trackPageView']);
    		}
            _paq.push(['enableLinkTracking']);
            _paq.push(['setTrackerUrl', u+'stats/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+'stats/piwik.js'; s.parentNode.insertBefore(g,s);
    
        $(window).on('action:ajaxify.contentLoaded', function(ev, data) {
            firePiwik(data);
        });
    })();
    </script>
    <noscript><p><img src="https://our.piwik.com/stats/piwik.php?idsite=1&rec=1&bots=1" style="border:0;" alt="" /></p></noscript>
    <!-- End Piwik Code -->
    

  • Admin

    @hmj can you provide the result of git rev-parse HEAD? I have a feeling you're on a commit with a feature we've temporarily rolled back



  • @julian said in How To: Piwik and NodeBB:

    git rev-parse HEAD

    02370b30d934006fe1db8575cccf6a42ac71431e



  • Awesome , thanks for the info..


 

| |