> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Linking Matomo as a source Canonical URL: https://posthog.com/docs/data-pipelines/sources/matomo > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://app.posthog.com` (app host for links). ## On this page - [Adding a data source](#adding-a-data-source) - [Available tables](#available-tables) - [Sync details](#sync-details) - [Configuration](#configuration) - [Supported tables](#supported-tables) ![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_9608fcca70) ![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_dark_a92b0e022d) Let AI connect your sources for you Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog. `npx @posthog/wizard warehouse` ![PostHog Wizard hedgehog](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png) ![](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png)Let AI connect your sources for you 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 1. Go to the [sources tab](https://app.posthog.com/data-management/sources) of the data pipeline section in PostHog. 2. Click **\+ New source** and then click **Link** next to Matomo. 3. Enter your **Instance URL** – for example, `https://myorg.matomo.cloud` for Matomo Cloud or your self-hosted URL. 4. 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**. 5. Create an API token in Matomo under **Administration > Personal > Security > Auth tokens** and paste it into the **API token** field. 6. 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 | | `pages` | Per-day page URL breakdown | Incremental | | `goals_summary` | Per-day aggregate goal conversion metrics | Incremental | | `goals` | Goal definitions lookup table | Full refresh | | `event_categories` | Per-day event breakdown by category | Incremental | | `event_actions` | Per-day event breakdown by action | Incremental | | `event_names` | Per-day event breakdown by name | Incremental | **Incremental** tables sync only new or updated records on each run. **Full refresh** tables are re-synced entirely on each run. ## Sync details - The first sync backfills up to 365 days of history for all date-based tables. - The `visits` table uses `serverTimestamp` as 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`, `pages`, `goals_summary`, `event_categories`, `event_actions`, `event_names`) 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` (and `label` where applicable). - The `goals` table is a small lookup table containing goal definitions. It has no date dimension and is fully refreshed on each sync. ## 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 | — | | `pages` | Per-day page URL breakdown from Matomo's Actions API — one row per page URL. | Incremental, Full refresh | \_date | — | | `goals_summary` | Per-day aggregate goal conversion metrics across all goals from Matomo's Goals API. | Incremental, Full refresh | \_date | — | | `event_categories` | Per-day custom event breakdown by event category from Matomo's Events API — one row per event category. | Incremental, Full refresh | \_date | — | | `event_actions` | Per-day custom event breakdown by event action from Matomo's Events API — one row per event action. | Incremental, Full refresh | \_date | — | | `event_names` | Per-day custom event breakdown by event name from Matomo's Events API — one row per event name. | Incremental, Full refresh | \_date | — | | `goals` | The goals configured for the site in Matomo — one row per goal. | Full refresh | — | — |