Matomo Tracking Code
-
Hi guys,
Anyone tryed Matomo with Quasar SSR?
Any tip would be nice.
Thank you!
-
@PeterQF I haven’t but if I were going to do it, I would create two boot files (one that is client only, and one that is server only).
In the server boot file, I would use a library such as: https://github.com/matomo-org/matomo-nodejs-tracker to call the initial track action. You can get all sort of info about the request from
ssrContext.req
, like IP address, etc.In the client boot file, I would probably use
router.afterEach
hook to trigger the ajax request. As far as including the matomo script, I’d just put that in the index.html template file.Hope that gives you some help, or idea where to start.
Edit: another option could even be to do nothing on server side, and call the ajax api on both boot, and router hook. that route might be easier.
-
@beets thank you.
I found this: https://github.com/AmazingDreams/vue-matomo anything usefull you think?
-
@PeterQF Yup, that looks like it would work, basics steps would be:
- Install with
yarn add vue-matomo
- Add a new boot file:
quasar new boot matomo
- Edit quasar.conf.js and add into the boot array:
boot: [ { path: 'matomo', server: false}, ]
- Edit
src/boot/matomo.js
and make it look like this:
import VueMatomo from 'vue-matomo' export default ({ Vue, app, router }) => { Vue.use(VueMatomo, { router, /** Other configuration options **/ }) }
It’s untested on my end, but sounds like it should just work out of the box.
- Install with
-
@beets thanx, i will try it and report back here on the result.
-
I am also very interested in the results! And maybe a comparison with Google Analytics from your experience.
-
@dobbel so, not entirely decided on GA or Matomo,
My customer has the final word but so far we both lean towards Matomo.Matomo is more “clean” and easier to navigate. Further more Matomo offers Session recordings and Heatmaps in the payed version for like 300 USD/year. GA dont offer this at all as we can see. Maybe there is some of this in GA 360 but when prices starts at ridiculous levels my customer is not interested in a payed GA service.
I have some problems getting the page Titles work but this was more of a problem back in Joomla days when GA registered unreadable urls, This is no problem in Quasar as the SEO friendly url:s are more than enought to understand. Also a very neat function Matamo has is a categorising of page hits. Much more readable than GA.
I use the vue-matomo like above and it workd great. I parallel run a GA tracking code in the index.temlate.html that seems to work but maybe this is the wrong way to use GA with Quasar because i get very different stats. GA gives me more hits but less page views and this makes me a bit confused.
My customer trust Matomo more since the stat ads up when comparing all different stats and GA don’t. But then again, maybe my GA implementation is not correct.
So bottom line right now: Matomo is the service we are leaning towards. Next week we will start an AdWord campaign and continue to compare stats. I guess this will be the dealbraker for the final decision.
So a list of things we think Matomo does better (based on our non-professional knowledge):
- Session Recordings
- Heatmaps
- Presentation of stat data
- By the looks of it a bit more “trustworthy” stat
- The ability to have many sites and easy switch between them
- The ability to remove all stats for a website when we are ready to start using it in production
- The great API in Matomo that allows us to get RAW data from Matomo and present it in our own Quasar page with chart script of our choosing.
So thats it so far. Hope it can be of some interest.
-
@PeterQF said in Matomo Tracking Code:
Matomo
Thanks for the extensive review/comparison.
Another big difference from GA is that you can self host Matomo server part. So you’re in control of your data.
btw for free (limited to 3) heatmaps I use hotjar:
https://www.hotjar.com/ -
I share my experience here, my client used to work with Piwik (now Matomo). The project has split with Matomo and Piwik Pro. From my last try/project Piwik Pro does not work with the VueJS Matomo component. So pay attention to the Matomo/Piwik version you (or your clients/projects) use.
-
@jraez correct. I also used Piwik a few years ago and was quite happy with it. Since Matomo dont share/sell my data i rather pay for the hosting service. And as i can controll /access my data from Matomos server just as i would if i hosted it my self i think it’s quite convenient not having to set up my own stat server and deal with backups and what not.
Maybe i had used a self hosted system if i were to sell stat services to my customers but i only charge them for the time i spend helping them set up their own GA/Matomo accounts and their own AdWords account.
I want them to have full controll over their money they spend on payed trafic. There are so many shady companies promising fantastic results and all they do is put a big chunk on the customers money in their own pockets.
Many of these companies present their own stat reports that doesn´t even come close to the real data. At least here i Sweden. I got a call from a client this morning that were so upset with the false stat we discovered doing our own stat cehcking he confronted the company demanding to get access to the used AdWords account and he pays 3000 SEK every month and the company used 1300-1400 SEK on the actual campain. When he asked why they told him “we take a 50% fee for your campains” and this they never informed him about. On top of that they have been taking over 50% systematically for god knows how long.
-
This post is deleted!