Using the Google Analytics Importer plugin, I’m attempting to migrate GA4 data into Matomo for a high-traffic site (around 3M pageviews/year).
This is a local Matomo install with MariaDB. The GA4 Web Property (No UA data) has no custom metrics, and I’m using the tool in Admin > System > Google Analytics Import.
The importer completes “successfully,” (took about 4 hours) but I’ve noticed significant gaps in the archived reports. While monthly and yearly totals seem to track accurately, many individual pages are wildly undercounted (often several x lower than GA4) with no obvious pattern.
Example pageview counts for a 90 day range:
GA: 465 Matomo: 35
GA: 167 Matomo: 51
GA: 253 Matomo: 43
Interesting that many high traffic pages I’ve checked appear to be 100% accurate, or within acceptable ranges (given the differences between how GA and Matomo track data), leading me to think perhaps it’s just lower traffic pages:
GA: 24064 Matomo: 24064
GA: 5115 Matomo: 5115
GA: 1747 Matomo: 1597
But then I’ve also found many really low traffic pages that are accurate too.
To handle the traffic volume, I have fully enabled and verified LOAD DATA INFILE support:
FILE privilege granted to the Matomo DB user.
local-infile=1 enabled in MariaDB.
mysqli.allow_local_infile=On in PHP.
Diagnostics > System Check shows a green checkmark for LOAD DATA INFILE.
One thing I’ve confirmed via GA4 Query Explorer is that Google does NOT appear to be thresholding the data; the API appears to be sending the full counts. Furthermore, querying the matomo_log_action table via phpMyAdmin shows only a single hit recorded for these URLs, suggesting the data is being lost during the Import/Write phase, not the Archive/Report phase.
Also confirmed via SQL that the rows simply do not exist in the matomo_log_… tables.
I also attempted smaller 90-day range but the undercounting persists.
The gaimportlog contains some warnings regarding unknown device brands, but no explicit SQL timeouts or “Access Denied” errors since fixing the FILE privileges.
Questions:
Is there a known limitation where the GA4 importer drops rows during high-volume transfers?
Why would the importer successfully record the “Total” counts for the month but fail to write the specific page_view log entries for the individual URLs?
Are there specific MariaDB or PHP buffer settings (beyond max_allowed_packet) that I should check to ensure these thousands of individual rows aren’t being truncated?
Any guidance would be greatly appreciated. Thank you