# Piwik PRO

Piwik PRO can replace Google Analytics 4 as the source of your analytics data: organic traffic, traffic from AI assistants, goals and e-commerce orders. Semactic reads this data and never changes anything in Piwik PRO. The connection is set per market: select the right project and market in the top bar before you start.

## Create an API key in Piwik PRO

### Open your profile
In Piwik PRO, open the menu, then your profile (click your email address).

### Create the key
Go to **API keys** and click **Create a key**. Give it a name, for example "Semactic".

### Copy the client ID and the client secret
Copy them right away: Piwik PRO shows the secret only once.

> [!NOTE]
> The key reads what its user can see: create it with a user who has at least view access to the site.

## Connect Semactic

### Enter the key
In **Integration**, click **Connect** on the **Piwik PRO** card. Enter the **Piwik PRO address** (for example `your-account.piwik.pro`; you can paste the address from your browser, anything after the domain is ignored), the **Client ID** and the **Client secret**, then click **Connect Piwik PRO**.

### Choose the site
In **Piwik PRO site**, select the site tracked by this market.

### Set the tracking type
Choose **Conversion** (then up to 30 goals in **Select goals**), **Revenue** or **Transaction**.

### Save
Click **Save site**. The data appears after the next import.

> [!WARNING]
> A market uses only one analytics source. If Google Analytics 4 already feeds its dashboards, the card tells you: saving the Piwik PRO site switches the market to Piwik PRO.

The secret is stored encrypted and is never shown again. When you reconnect to the same address with the same client ID, leave it blank to keep the stored one. **Unlink** removes the selected site. **Disconnect** deletes the API key and stops the import; data already imported stays in your dashboards.

## Troubleshooting

| Message | Likely cause |
|---------|--------------|
| No Piwik PRO account answered at that address | Check the address, in the form `your-account.piwik.pro`. |
| Piwik PRO refused this client ID and secret | One of them is incomplete, or the API key was deleted. |
| This API key cannot read the site | Give its user at least view access to the site in Piwik PRO. |
| Piwik PRO says this account has no valid licence for the API | The Piwik PRO account has no API access: check with Piwik PRO. |
| Piwik PRO is rate-limiting us | Wait a minute and try again. |
