Changelog
No action required. Units already saved for your websites are kept.
WeatherReports.getSiteUnits and WeatherReports.setSiteUnits (admin access)No action required. No database migration: existing data, settings, Tag Manager tags and tracking codes keep working as before. Republish your Tag Manager container to use the new Weather tag.
Weather conditions in the language of each user - Condition texts are matched against the official WeatherAPI list (60 conditions, 40 languages, day and night) and displayed in the language of the Matomo user, in the Condition report and in the visitor log - The same condition tracked in several languages is merged in one report row, including already tracked data - Condition report rows get a segment (every tracked text of the row) for the segmented visitor log - Texts WeatherAPI used to return ("Patchy rain possible", ...) are recognized, unknown texts are kept as tracked
Units follow the website settings
- The Weather tag sends metric values with a unit system marker (weather_units=metric), Matomo converts them to the units of the website settings when tracking, so stored values always match the displayed units
- The tag unit parameters are removed: tags saved with them keep working, the values are ignored and dropped on the next save
- setWeather() accepts a 12th argument 'metric' or 'imperial', calls without it are stored as sent like before
WeatherAPI key kept on the server
- New WeatherAPI key plugin setting (Administration → General settings → WeatherReports)
- New public endpoint index.php?module=WeatherReports&action=getWeather&lang=fr: Matomo calls WeatherAPI with this key and caches responses 30 minutes per location. WeatherAPI receives the coordinates found by Matomo geolocation rounded to about 10 km, or the visitor IP without its last byte
- The Weather tag uses this endpoint when its own API key is left empty (new Matomo URL parameter, prefilled), tags with an API key keep calling WeatherAPI directly
Settings
- Unit settings and the tag language are single values (TYPE_STRING) instead of arrays. Values saved by previous versions (["c"]) are read as is, the next save stores a string
Tests - add: PHPUnit tests for condition matching and translation, report row merging, unit conversion, the WeatherAPI client and legacy setting values
Action required after upgrading 1. Republish your Matomo Tag Manager container so the updated
Weathertag is served. 2. If you use the plain JS snippet (no MTM), copy the updated snippet fromdocs/index.md.
Matomo 6
- Compatibility with Matomo 6.x (>=6.0.0-b1,<7.0.0-b1)
- Requires PHP 8.1+, MySQL 8.0+ or MariaDB 10.6+
- Update plugin homepage URL
- Visitor log weather card rendered by a Vue component (WeatherReports.VisitorWeather) built with Vite, Twig template removed
- getUserIp controller action declared with the #[JsonResponse] attribute
- Remove the listener of the CronArchive.getArchivingAPIMethodForPlugin event, no longer triggered by Matomo
Tracking
- fix: weather is added to the tracking requests (page views, events, site searches, links, ecommerce) of every page, a ping is only sent when the page view of the page was already tracked. Before, a single ping per browser session was sent: Matomo ignores a ping that would start a new visit, so the weather was lost when the ping reached Matomo first, and visits started later in the same browser session (after 30 minutes of inactivity) had no weather.
- fix: tracking parameters are URL encoded (conditions such as Pluie & brouillard were truncated) and missing values are no longer sent as undefined
- fix: felt temperature accepts the same range as temperature (-100..200), heat indexes above 100 °F were dropped
- Tag Manager: WeatherAPI response cached one hour in sessionStorage and reused on every page, sessionStorage errors handled, works when _paq is not defined yet
- getUserIp endpoint readable from any origin (Access-Control-Allow-Origin: *), it only returns the caller's own IP
Reports
- Humidity, Pressure and Wind speed displayed as bar charts like the other scale reports
- Unit of the website shown in the label column title, e.g. Temperature (°C)
- Report classes share their configuration (category, goal metrics, label translation)
Visitor log
- New weather card: condition, temperature and felt temperature, measures grid, wind direction arrow, numbers formatted with the user locale, light and dark themes
- Weather condition no longer displayed with HTML entities (&, ')
Tests - add: Vitest specs for the card value formatting and wind arrow - add: PHPUnit tests for unit symbols and the felt temperature range
⚠️ Action required after upgrading 1. Database migration — Matomo will prompt you to upgrade the schema on activation.
weather_pressureandweather_visibilitywidenINT → FLOAT;weather_wind_directionnarrowsVARCHAR(255) → VARCHAR(8). Existing data is preserved (the 16-point compass is ≤3 chars). 2. Republish your Matomo Tag Manager container. The bundledWeathertag template (WeatherTag.web.js) was rewritten — published containers keep serving the old JS until you publish a new version. 3. If you use the plain JS snippet (no MTM), copy the updated snippet fromdocs/index.mdso you also drop the third-partyipapi.cocall.
Privacy / data flow
- remove: third-party ipapi.co IP-lookup. The Matomo Tag Manager template now uses WeatherAPI's built-in q=auto:ip so visitor IPs are no longer shared with a second service.
- add: public WeatherReports&action=getUserIp Controller endpoint as a self-hosted IP-resolution fallback for CDN/proxy setups (uses Matomo's IP::getIpFromHeader(), honours proxy_client_headers).
- harden: tag JS now bails out cleanly on missing API key, HTTP errors, malformed responses, and unavailable sessionStorage.
Tracking & validation
- refactor: Columns/ now share a single Base class — ~1,500 lines of duplicated dimension boilerplate replaced by ~200 lines.
- fix: input is type-cast (int/float/string) at the tracker via Common::getRequestVar instead of being stored as raw strings.
- fix: out-of-range values are dropped at ingest:
- Cloud / Humidity: 0-100
- UV: 0-20
- Temperature / Felt temperature: -100..200
- Pressure: 0..2000 (covers both mb and inHg)
- Visibility / Precipitation / WindSpeed: 0..1000
- WindDirection: must match the 16-point compass (N, NNE, NE, ENE, …, NNW)
- fix: string columns (Condition, WindDirection) no longer write integer 0 when the request has no value — they store null.
Schema
- fix: weather_pressure is now FLOAT NULL (was INT(10)) so values in inHg keep precision.
- fix: weather_visibility is now FLOAT NULL (was INT(10)) so values in miles keep precision.
- fix: weather_wind_direction is now VARCHAR(8) NULL (was VARCHAR(255)) — the 16-point compass max is 3 chars.
- A standard Matomo schema migration prompts admins on next activation; existing data is preserved (INT→FLOAT widens losslessly).
Reports
- fix: scale reports (Temperature, Pressure, Humidity, …) sort numerically by label so chart x-axes read 1, 2, 10, 20 instead of 1, 10, 2, 20.
- fix: categorical reports (Condition, WindDirection) sort by visit count and no longer collapse all rows into a single 0 bucket from a stray (float) cast.
- add: categorical report tables show top 15 rows + "Others" by default (was Matomo's 5).
- chore: dedupe the rounding closure in API.php — six methods now share one getRoundedScaleDataTable() helper.
Visitor log
- ui: redesigned weather panel as a themed card with a header line (Weather · Condition + temperature with felt-temp suffix) and a 2-column metric grid below.
- ui: units (°C/°F, mm/in, mb/inHg, km/mi, km/h/mph) are rendered next to each value, read from the existing per-site MeasurableSettings (those settings are now actually wired in).
- ui: light/dark theme aware — colors and surfaces use Matomo's CSS variables (--theme-color-text, --theme-color-text-light, --theme-color-border, --theme-color-background-contrast) with hex fallbacks. DarkTheme, GoogleTheme and Morpheus all match automatically.
- ui: rows with no recorded value are hidden (no more bare °C / mb / % suffixes); the whole card is skipped if a visit has no weather data at all.
- harden: renderVisitorDetails is wrapped in try/catch and logs to tmp/logs/ instead of breaking the visitor log if rendering fails.
Other
- fix: removed broken Live\Model::getCRMData / getAdviews calls in WeatherReports.php (copy-paste leftovers from another plugin; methods don't exist).
- chore: deleted dead commented-out MeasurableSettings::makeWeatherLangSetting (~50 lines) and empty config/config.php / config/tracker.php.
- chore: dropped boilerplate example comments from every Columns/*.php file.
Tests
- add: 53 PHPUnit unit tests covering every column's bounds, type coercion, the 16-point compass validator, and Condition's UTF-8 truncation.
- add: phpunit.xml with Unit and Integration test suites.
Docs
- rewritten classic-snippet docs (no more ipapi.co), documented the optional getUserIp endpoint, refreshed the dimensions table to reflect the FLOAT migrations, added a privacy note.
fix: Archiving issues
fix: Sorting deprecated method replace with "label"
The great update you waited for!
support: Conversions reports update: translations for DE, ES, IT, NL and SV refactor: ReportsBuilders enhanced bar charts visualisation
add: Cover for marketplace
update: Documentation URL
update: MeasurableSettings
Support Matomo v5
Update documentation FAQ
Update tag language selector
Add screenshots
Add custom unit in Weather Tag from Tag Manager
Add screenshots and update documentation
Add Matomo Tag Manager Custom Tag
Support Matomo Tag Manager
Add FR translation
Change _paq.push(['WeatherReports.setWeather']) parameters order
Add fetch to IPApi to get rid of PHP global variable
Change request to PING=1
Rename screenshots
Add screenshots
Fix report Archiver.php class
Test #3 with methods in Archiver.php
Test #2 with abstract Class in Archiver.php
Test #2 with abstract method in Archiver.php
Remove abstract method from Archiver.php
Change blade view for VisitorDetails
Add abstract method to Archiver.php
Update IP Address
Update table in docs/index.md (Markdown tables are not supported by Matomo)
Plugin starting code base