• Extensions
  • FriendsOfFlarum Analytics - tracking user visits

SecurityDog did it stop working? I know we're still using the older "piwik" names and paths but I'm not aware of Matomo dropping the backward compatibility yet. I'm successfully running the extension with the latest Matomo on my website.

Okay for me it doesn´t work, but I disabled it now, because of DSGVO & GDPR ... Living in EU with an own website isn´t the easiest these days ...

    18 days later

    optimize installation causes error
    we have to manually add the whole script in extend.php for Checking optimize
    it misses gtag('config', 'UA-*******'); line

    • [deleted]

    SecurityDog use Matomo instead. I do and reside in the UK.

    This looks very useful and I really like this part with privacy, which package are you guys using and what is your experience with this, how much has it improved your business?

      • [deleted]

      bryantmilan I use the free and self hosted version.

      a month later

      Is there a way to do goal tracking for user sign up + confirmation.

      There is an option to set up tracking to a URL "that begins with", e.g. "site.com/confirm/"
      However, it doesn't appear the analytics head is delivered on this page (or it redirects before the code loads?)

      Please let me know if you can think of a way how to accomplish this with the current extension.

      Thanks!

        cmwetherell that's unfortunately not possible without additional code. You'd need to use Flarum's javascript extension API to extend additional events/methods and call your tracking code from there.

        The analytics code from this extension indeed does not run on confirmation pages, password reset pages, or 404/403 pages. Only pages inside of the Single Page App of Flarum are tracked.

          cmwetherell if you want to do something during a request that leads to a redirect, you could use a Middleware.

          Otherwise for other non-SPA pages I'm not seeing any easy tracking method. There is a plan to move error pages to the SPA flarum/core2214 and it would also be nice to eventually move the reset/email pages to the SPA as well, to allow for a better integration across the pages.

          Those non-SPA pages use the basic template which doesn't allow any easy customization by extensions https://github.com/flarum/core/blob/master/views/layouts/basic.blade.php An extension could completely replace it, or inject stuff at the start or end. So injecting the tracking code from this extension on those pages isn't really easy.

          To track a click to login or register, you could use the direct link extension and replace all occurrences of the login/register button with that link. The paths should trigger a view in Analytics.

          18 days later

          cmwetherell I was just looking into this. Their upgrade instructions are not very clear. I am not sure how to use the new version.

          a month later

          0.10.0

          • beta 14 ready 🥳
            -- tested with GA/GTM (not GA4)
            -- untested with piwik, but should be fine.
          Updating
          composer require fof/analytics:^0.10.0
          php flarum cache:clear
          7 days later

          Hi, Google Analytics 4 doesn't seem to have a tracking id, so I tried inputting the measuring id but it didn't work... Anything I can do?

          8 days later

          0.10.1

          • Fix Piwik/Matomo
          • Probably fix GTM since it was using the same broken code (but I wasn't able to test that either)
          composer require fof/analytics
          php flarum cache:clear
          8 days later
          14 days later
          19 days later

          IanM Is the FoF team planning to add Microsoft Clarity support? Clarity also can collect Google Analytics data directly from Google.

            tolgaaaltas it's not something that has been considered so far, that I'm aware of.