FriendsOfFlarum Analytics - tracking user visits
This thread needs moderation attention ? I'm at a loss where to start splitting though ?
For me Piwik integration did not work with this extension. _paq.push(['setSiteId', '1']);
gets included with ##piwik_options##
and not at its appropriate place after _paq.push(['setTrackerUrl', u+'piwik.php']);
, so nothing got tracked.
I don’t know if this was also responsible for the iframe only giving a 500 error in the Flarum admin interface, but possibly?
I have now manually included the correct tracking code in core/views/app.blade.php
and tracking works.
But it only tracks initial visits and when you refresh a page. So not pages visited via the forum navigation (until refreshed). Is there a setting to change this behaviour or is it just due to how Flarum is built?
Do you think you could add an option to set the username ie
_paq.push(['setUserId', '<?=$user['username']?>')
That's from my site not Flarum
Thanks,
Larry
jenolan where would that $user
variable come from ?
Registering the Flarum username, email or id as the Piwik user id with this extension would make sense though.
- Edited
The username is what it wants, non-logged in you just do not set it. Of course the email (etc) an option setting?
I implemented the feature https://github.com/flagrow/flarum-ext-analytics/pull/12
It will be available in the next release, once I get somebody else from Flagrow to review my PR ?
I also fixed the url tracking when browsing from page to page inside Flarum (the url didn't change in the Piwik logs when browsing from page to page inside Flarum).
- Edited
clarkwinkelmann excellento thanks for a helpful plugin even better!
- Edited
Just released version 0.6.0
!
Update with the following command (or use Bazaar):
composer require flagrow/flarum-ext-analytics
php flarum cache:clear
This extension didn't receive much love during this year... It was about time:
- Fixed Piwik not tracking page url change correctly
- Added the option to track users by username or email in Piwik, following jenolan suggestion. It's disabled by default
- Added the option to specify a protocol with the Piwik domain, so you can force
https://
analytics for non-https forum for example. Defaults to//
as before if not specified - Updated the settings UI to use Flarum components instead of non-styled HTML inputs
- Fixed a potential XSS vulnerability if you enabled the "Track subdomains" option
- Cleaned up the code
Edit: replaced composer update flagrow/flarum-ext-analytics which does not work to update to that new version ?
- Edited
clarkwinkelmann Heya Thanks! Will install and give it a whirl!
Just tried to upgrade doesn't load via composer
php flarum cache:clear
rm -f assets/rev-manifest.json
Also hard refresh (CTRL+F5) your browser.
jordanjay29 much appreciate it.
jordanjay29 I have done all that but I get same results (like in the screenshot). ?
Radu if you're using cloudflare also clear that cache, clear your browsers cache hard (!) and run the command jordanjay29 mentions.
no analytics tab ? what to do ? i already active the google analytics option and add the Track code ID...
Any update for beta 0.7?