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

Without the dashboard

The top slot of your browser can send requests to Tracking API & Reporting API
The command line of your browser can accept direct Matomo input (e.g. the PHP ./console command).
On this page are a variety of things you can do without ever touching the visual dashboard (Matomo GUI)

MySQL cookbook

10/26/2023

0 Comments

 

How to 99% of everything your Matomo dashboard knows is stored and retrieved from its MySQL database. Here are a half dozen useful queries:

LOOKING FOR A COLUMN BY NAME, LIMIT IT TO ONLY ONE DB
SELECT TABLE_NAME, COLUMN_NAME name FROM information_schema.columns WHERE COLUMN_NAME LIKE "%key%" AND table_schema = 'XYZfurnace_mat_jan2022';

DELETE THE CONTENTS BUT NOT THE TABLE
In SQL, to delete the rows:

TRUNCATE TABLE table_name;

INSPECT THE RAW DATA
If you want to directly check for the raw data in the SQL database you could also run a query for the date, similar to
SELECT * FROM matomo_log_visit WHERE visit_first_action_time > '2023-10-21' AND visit_first_action_time < '2023-10-22';

INSPECT RAW DATA FROM THE DASHBOARD ITSELF.
1) Dashboard >> Visitors >> Visits log    (Tableau de bord >> Visiteurs >> Journal des visites)
OR
2) Dashboard >> ⚙️  >> Platform >> API  (Tableau de bord >> ⚙️  >> Plate-forme >> API)

SEE EVERY COLUMN NAME IN THE ENTIRE DATABASE
This is a great flyby of the entire data table. You can also get the lay of the land by simpling searching online for matomo data schema. SQL feels more exciting because you're seeing it in situ.

SELECT TABLE_NAME, COLUMN_NAME name FROM information_schema.columns ORDER BY COLUMN_NAME;

SEE EVERY COLUMN NAME IN THE ENTIRE DATABASE SIMILAR TO ID VISIT
This is useful if you think you know a variable name from a cookie or from the data layer or something and you wonder where is it stored in the database.
SELECT TABLE_NAME, COLUMN_NAME name FROM information_schema.columns WHERE COLUMN_NAME LIKE '%id%visit%';

SEE HOW TO BUILD THE TABLE 
DESCRIBE matomo_log_action ;
SHOW CREATE TABLE matomo_log_action ;

MORE QUERIES
For lots of great SQL query recipes, see the official Matomo SQL cookbook:
https://matomo.org/faq/how-to/how-do-i-write-sql-queries-to-select-visitors-list-of-pageviews-searches-events-in-the-matomo-database/

How to see the scheduled tasks in Matomo.
Use SQLto see the scheduled tasks in Matomo (these run at the end of any core:archive run or can be run manually with core:run-scheduled-tasks.
  1. In the db, SELECT * FROM matomo_option WHERE OPTION_NAME LIKE "%sched%" ;
  2. Break the lines on semicolon.
Picture
foooo
fooooo
​barrrrrrrrrrr
0 Comments

    Author

    Evan Genest

    Archives

    November 2024
    August 2024
    May 2024
    March 2024
    February 2024
    November 2023
    October 2023
    September 2023
    August 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