• Extensions
  • FriendsOfFlarum Analytics - tracking user visits

FrederikDan there is no official way to do it at this time.

You can edit the piwik-analytics.html file in the vendor folder https://github.com/FriendsOfFlarum/analytics/blob/master/resources/js/piwik-analytics.html but there's a risk the changes will be lost every time you install or update any extension.

A more reliable solution would be to use the Flarum frontend content extender, and loop though $document->head, find the javascript block for Matomo and perform a string modification on it.

    I encounter an error, people might be losing visits.

    If we use the normal Tracking Code ID UA-XX
    And adding the GTM code ID's

    That way it will track the first visit when you enter the url but will not track when you start navigating.

    If you use GTM code ID's alone, without Tracking Code ID UA-XX , the same thing will happen, no tracking when you start navigating.

    But if you use Tracking Code ID UA-XX , only, without putting GTM id's , it will track all pages you are navigating.

    7 days later

    So I added Tracking Code ID, now what? Where are the statistics? I don't see any changes in Admin,

      Anonymous43 which provider?

      For Google Analytics, visit the Google Analytics dashboard on google's domain.

      For Matomo, visit your Matomo instance. Optionally Matomo can be shown inside an iframe in the admin panel as described in the settings.

      So, it has absolutely nothing to do with flarum admin panel. In theory I can just view the stats from google without this extension.

        Anonymous43 yes, that's how it's intended to be used.

        The role of this extension is to perform the collection of the data. It's used instead the tracking code you usually paste in the header/footer. The code added by this extension tracks navigation inside of the single page app, which is not done if you just paste the code Google gives you.

        2 months later

        I can't see google analytics Tracking Code ID starting with " UA-XXXX" ...... I can only found the Tracking Code ID Like " G-XXXX " .

          2 months later

          Is it compatible with Flarum 1.2?
          Extiverse helper tells it is not 🙁

            almalino that was a temporary bug. The helper should now report things differently. Sorry for the confusion.

            7 days later
            9 days later

            matomo:
            Refused to display 'https://www.*****.com:9000/' in a frame because it set 'X-Frame-Options' to 'deny'.

            [General]
            enable_framed_pages=1

            无效

            3 months later

            r4nchy I have not studied the changes yet. Do you know whether it requires modifications to the javascript we embed in the extension?

            17 days later

            Hello, I would like to report a bug. I have disabled all extension and discovered that this extension is causing errors in my website:

            Console:

            45
            sw:57 Uncaught ReferenceError: fetchEvent is not defined
                at sw:57:18
            6
            sw:57 Uncaught ReferenceError: fetchEvent is not defined
                at sw:57:18
            15
            sw:57 Uncaught ReferenceError: fetchEvent is not defined
                at sw:57:18
            7
            sw:57 Uncaught ReferenceError: fetchEvent is not defined
                at sw:57:18
            12
            sw:57 Uncaught ReferenceError: fetchEvent is not defined
                at sw:57:18
            7
            sw:57 Uncaught ReferenceError: fetchEvent is not defined
                at sw:57:18
            12
            sw:57 Uncaught ReferenceError: fetchEvent is not defined
                at sw:57:18
            32
            sw:57 Uncaught ReferenceError: fetchEvent is not defined
                at sw:57:18
            3
            sw:57 Uncaught ReferenceError: fetchEvent is not defined
                at sw:57:18

              girefko that code is not in this extension, nor it is in Flarum core. The sw: reference means it comes from a service worker I believe. This extension doesn't use service workers.

              Wasn't it a PWA extension issue? You might need to clear your browser cache and storage after removing that extension because a service worker won't uninstall itself automatically.

                clarkwinkelmann You are right.. I was using Chrome all along and no matter what I did - the error would not go away. I then switched to Firefox and the error disappeared.

                a month later