# WordPress (https://webmetic.de/docs/en/installation/wordpress)

The official Webmetic plugin adds the tracking code to every public page of your WordPress website. You don't edit a theme file or write code, and when you're done, Webmetic shows your website as **Active**.

## Before you start [#before-you-start]

- **Time**: Setup takes a few minutes.
- **Account**: You need a Webmetic account, but no admin rights in Webmetic. Your website must be listed in **Website management**, where Webmetic adds your sign-up website automatically.
- **Access**: Your website needs WordPress 5.7 or later and PHP 7.4 or later. If you don't have access, forward this page to your agency or IT team.
- **Rights**: In WordPress, only an administrator can install plugins, and on a multisite network only the super admin.
- **Plan**: The plugin works on every plan and costs no credits. The trial lasts 14 days and only starts once Webmetic detects your tracking code for the first time.

## 1. Copy your account ID [#1-copy-your-account-id]

The plugin needs your account ID so Webmetic can assign the visits to your account.

The **Tracking Code** window has no WordPress option, so the ID appears there under **Google Tag Manager**.

1. In Webmetic, open [**Menu** > **Tracking code**](https://app.webmetic.de/?menu=tracking_code). The **Tracking Code** window opens.
2. Click **Google Tag Manager**. Webmetic shows the **Account ID** box with the **Copy ID** button.
3. Click **Copy ID**.

![The Google Tag Manager method with the account ID and the Copy ID and Open GTM template buttons](https://webmetic.de/docs/media/en/light/trackingcode-gtm.webp)

As long as no website is **Active** yet, the setup assistant also shows the ID on the **WordPress plugin** path.

## 2. Install the plugin [#2-install-the-plugin]

1. Sign in to WordPress at `your-website.com/wp-admin`.
2. Open **Plugins** > **Add Plugin**. On WordPress 6.4 to 6.7 the menu item is called **Add New Plugin**.
3. Type "Webmetic" into the **Search Plugins** field. WordPress shows the "Webmetic" card by Webmetic GmbH.
4. On the card, click **Install Now**.
5. Click **Activate**. Without an account ID, the plugin doesn't add the tracking code yet.

![The WordPress plugin search with the Webmetic card and the Install Now button](https://webmetic.de/docs/media/en/light/wordpress-plugin-suche.webp)

## 3. Set up the plugin [#3-set-up-the-plugin]

1. In WordPress, open **Settings** > **Webmetic**, or click the **Settings** link next to the plugin under **Plugins** > **Installed Plugins**. The **Webmetic Settings** page opens.
2. Paste your account ID into the **Account ID** field exactly, because the plugin doesn't check it.
3. Leave the **Script Placement** option on **Footer (Recommended)**. Either way the tracking code loads in the background, so only its position in the page source changes.
4. Optional: Tick **Enable Session Replay**. The box starts unticked in the plugin, while the dashboard's tracking code has it ticked.
5. Click **Save Settings**. WordPress shows "Settings saved." at the top.
6. If your website uses a caching plugin, clear its page cache there. Until then, the cache serves your pages without the tracking code, because the Webmetic plugin doesn't clear it.

![The Webmetic Settings in WordPress with the account ID, the script placement, and the confirmation after saving](https://webmetic.de/docs/media/en/light/wordpress-einstellungen.webp)

The checkbox switches on session recording: Webmetic records mouse movements, clicks, and scrolling, while form inputs stay hidden.

You can watch recordings during the trial and on the Growth plan or higher. If your plan includes them, tick the box.

With WP Rocket, LiteSpeed Cache, Perfmatters, SG Optimizer, FlyingPress, Autoptimize, and W3 Total Cache, the Webmetic plugin excludes the tracking code from the most common optimizations. If a plugin still delays the code, see "Optimization plugin" under "If nothing arrives".

You copy the text for your privacy policy in the **Tracking Code** window under **Privacy notice**. You'll also find the text in German and English under [Add the privacy notice](https://webmetic.de/docs/en/installation/alle-plattformen#4-add-the-privacy-notice).

## Check your installation [#check-your-installation]

1. Open a public page of your website. Your own visit counts, because the plugin also tracks logged-in WordPress users and admins.
2. Optional: Open the page source and search for `webmetic-bootstrap`. If you find it, the plugin is adding the tracking code.
3. In Webmetic, open [**Menu** > **Tracking code**](https://app.webmetic.de/?menu=tracking_code) and click **Quick check** under **Verify installation**. Webmetic shows right away whether data is arriving.
4. Open [**Menu** > **Websites**](https://app.webmetic.de/?menu=websites) and click the **Refresh status** icon (↻). Your website now shows the status **Active**.

![Website management with the status Active](https://webmetic.de/docs/media/en/light/websites-aktiv.webp)

**Active** means Webmetic has received data with your account ID in the last 24 hours. The first data arrives after a few minutes. The first companies appear within minutes to hours, depending on how much traffic your website gets.

The **Deep check** opens your website and looks for the tracking code there, but only on the first website in your account, and only on its home page. For details, see [Check your installation](https://webmetic.de/docs/en/installation/pruefen).

### If nothing arrives [#if-nothing-arrives]

- **Status Not integrated**: A typo in the account ID leads to this status. Check the ID in WordPress, because the plugin doesn't flag a wrong ID.
- **Nothing in the page source**: Check that the plugin is active and an account ID is saved, then clear the page cache.
- **Still nothing in the source**: Switch the **Script Placement** option to **Header** and save, because some themes don't output the footer area.
- **Website missing from the list**: Add your domain under [**Menu** > **Websites**](https://app.webmetic.de/?menu=websites). How many domains you can add depends on your plan.
- **Optimization plugin**: In your optimization plugin, exclude `t.webmetic.de/iav.js` from combining, delaying, and minifying.
- **Consent tool**: If your consent tool blocks the tracking code until someone agrees, Webmetic only records visits after that click, so give consent yourself for the test.

For more cases, see [Special cases](https://webmetic.de/docs/en/installation/sonderfaelle).

<Accordions>
<Accordion title="Upload the plugin as a ZIP file">

1. Download the plugin as a ZIP file from [wordpress.org](https://wordpress.org/plugins/webmetic/).
2. In WordPress, open **Plugins** > **Add Plugin** and click **Upload Plugin**.
3. Choose the ZIP file and install the plugin.
4. Click **Activate Plugin**.

</Accordion>
<Accordion title="WordPress multisite">

On a network, enter the account ID on every website under **Settings** > **Webmetic**, because each website keeps its own settings. Each domain must also be listed in **Website management**.

</Accordion>
<Accordion title="Deactivate or delete the plugin">

A deactivated plugin stops adding the tracking code but keeps your settings. If you delete the plugin, WordPress also removes these settings, on a multisite network on every website.

</Accordion>
<Accordion title="Content Security Policy with a nonce">

With a nonce-based Content Security Policy, your IT team adds the nonce through the WordPress filter for inline scripts.

</Accordion>
</Accordions>

## Next steps [#next-steps]

- [Check your installation](https://webmetic.de/docs/en/installation/pruefen): Every check and status in detail.
- [Special cases](https://webmetic.de/docs/en/installation/sonderfaelle): Strict security rules, test websites, and other cases.
- [Get started](https://webmetic.de/docs/en/erste-schritte): Save your target customers as a segment and send them to your CRM.
