Linking Matomo as a source
This source is currently in alpha. The interface and available tables may change.
Connect your Matomo instance to pull web analytics data into the PostHog data warehouse. Works with both Matomo Cloud and self-hosted instances.
Adding a data source
- Go to the sources tab of the data pipeline section in PostHog.
- Click + New source and then click Link next to Matomo.
- Enter your Instance URL – for example,
https://myorg.matomo.cloudfor Matomo Cloud or your self-hosted URL. - Enter your Site ID – the numeric ID for the site you want to import. You can find this in your Matomo instance under Administration > Measurables/Websites > Manage.
- Create an API token in Matomo under Administration > Personal > Security > Auth tokens and paste it into the API token field.
- Select the tables you want to sync, set the sync method and frequency, then click Import.
Once the syncs are complete, you can query your Matomo data in PostHog.
Available tables
| Table | Description | Sync method |
|---|---|---|
visits | Raw visit log with visitor details, actions, and metadata | Incremental |
visits_summary | Per-day aggregate visit statistics | Incremental |
actions_summary | Per-day aggregate action statistics | Incremental |
referrers | Per-day referrer breakdown | Incremental |
countries | Per-day visitor country breakdown | Incremental |
Incremental tables sync only new or updated records on each run.
Sync details
- The first sync backfills up to 365 days of history for all tables.
- The
visitstable usesserverTimestampas its incremental cursor. Visits newer than one hour are deferred to the next sync to ensure their action lists are complete before storing. - Aggregate report tables (
visits_summary,actions_summary,referrers,countries) walk one day at a time and re-pull a 3-day trailing window on incremental runs to account for late archiving. Records are merged on_date(andlabelwhere applicable).
Configuration
| Option | Type | Required |
|---|---|---|
Instance URL | text | Yes |
Site ID | text | Yes |
API token | password | Yes |
Supported tables
| Table | Description | Sync method | Incremental field | Primary key |
|---|---|---|---|---|
visits | The raw visit log from Matomo's Live API — one row per visit with its actions and visitor details. | Incremental, Full refresh | serverTimestamp | — |
visits_summary | Per-day aggregate visit metrics from Matomo's VisitsSummary API. | Incremental, Full refresh | _date | — |
actions_summary | Per-day aggregate action metrics from Matomo's Actions API. | Incremental, Full refresh | _date | — |
referrers | Per-day referrer breakdown from Matomo's Referrers API — one row per referrer. | Incremental, Full refresh | _date | — |
countries | Per-day country breakdown from Matomo's UserCountry API — one row per country. | Incremental, Full refresh | _date | — |