Data Whimsy
  • Home
  • What is Matomo
  • Contact
  • Custom Reports
  • Connect Matomo to other software
  • CLI API etc
  • Matomo Tag Manager Simple Guide
  • Lyn Only
  • Troubleshooting + Deploying Matomo
  • Weird Data
  • Why is data in Matomo giving different numbers than Google Analytics
  • The Dashboard
  • Moving the Data
  • Book Club Forum

Day 0: Put the tracking code into your HTML

10/27/2023

0 Comments

 
  1. Get a few lines of tracking code from the Matomo Admin panel
    Dashboard >> ⚙️ >> Measurables >> Tracking code  OR Dashboard >> Tag manager >> Install code "< >"
  2. Paste that code into every page of your site. The easiest way is to paste it just once, into your header. Or footer.  Caveat: do you have any pages that don't use your header or footer? They will be unmeasured unless you insert the Javascript tracking code on those pages too.

See examples of tracking code in the HTML source code of these:
https://pikl.us
https://littlefurnace.com
https://tatll.me
https://genest.weebly.com

The last link above is using a tracking pixel.
0 Comments

October 23rd, 2023

10/23/2023

0 Comments

 
Enable debug logging on Matomo Tracking API

Symptoms: An event fires in the browser when someone visits your website, but nothing reaches the Matomo dashboard

First check with devtools in the browser to see whether the event is firing in the Network tab.
It may be convenient to send a manual event through to test this (replace example.com with the URL of where you send your Matomo traffic) :
https://example.com/matomo/matomo.php?rec=1&idsite=123&new_visit=1
or a more realistic event is this URL. I recycled it by opening Devtools >> Network tab to eavesdrop on some tracking requests that occurred while I browsed a real site:
https://littlefurnace.com/matomo/matomo.php?action_name=Evan%20Genest%20Web%20Developer%20homepage&idsite=1&rec=1&r=481840&h=8&m=34&s=7&url=https%3A%2F%2Flittlefurnace.com%2F&_id=d89e5d692dfdba06&_idn=0&send_image=0&_refts=1698068037&_ref=https%3A%2F%2Ft.co%2F&pdf=1&qt=0&realp=0&wma=0&fla=0&java=0&ag=0&cookie=1&res=2859x1206&pv_id=mfktev&pf_net=0&pf_srv=59&pf_tfr=0&pf_dm1=106&uadata=%7B%7D

If you can send these and you see no error in either the browser or the web server where your Matomo is running (look for a PHP error) you can see what the heck is Matomo doing once the request arrives at the Matomo server but fails to end up in your dashboard.

Hypothesis: Something goes wrong inside the tracker as Matomo tries to receive it. Sleuth this by turning on debug logging on Matomo Tracking API. This logging is too verbose to keep on all day, all week long. Caveat: besides being too verbose to leave enabled for long, it is also a bit of a security risk: it doesn't show secrets but it reveals details which modules and methods are being used on the Matomo backend.

To check what is preventing the data from being tracked properly, you can enable debug logging in the Matomo tracking API (matomo.php)

In debug mode, Tracking requests will output the tracking log messages in readable english, and it will clearly say any issue or reason why the request is not being tracked.

For security reasons, this should not be done in production or only for a very short time frame.

Follow these steps to enable and view debug logging for the tracker:
  1. In your config file path/to/matomo/config/config.ini.php , write the following:
    [Tracker] debug = 1
  2. Look at the HTTP requests that are sent to Matomo. You can use your browser's developer tools to see the output of all requests to matomo.php
If you want to only debug some specific requests you can alternatively enable debug_on_demand in config.ini.php :

[Tracker]
debug_on_demand = 1


In this case messages will be only logged for Tracker requests that have a URL parameter &debug=1 set. This is considered more secure but should be still only enabled for a short time frame.
Enable debug logging on Matomo Tracking API

Checklist for swimming in the deep water with Matomo

0 Comments

    Troubleshooting + Deploying Matomo

    Archives

    December 2024
    July 2024
    April 2024
    March 2024
    February 2024
    November 2023
    October 2023

    Categories

    All

Powered by Create your own unique website with customizable templates.
  • Home
  • What is Matomo
  • Contact
  • Custom Reports
  • Connect Matomo to other software
  • CLI API etc
  • Matomo Tag Manager Simple Guide
  • Lyn Only
  • Troubleshooting + Deploying Matomo
  • Weird Data
  • Why is data in Matomo giving different numbers than Google Analytics
  • The Dashboard
  • Moving the Data
  • Book Club Forum