---
title: "WordPress | Installation | Documentation - Vemetric"
description: "Easily integrate Vemetric into your WordPress website."
url: https://vemetric.com/docs/installation/wordpress
---

# Integrate Vemetric into your WordPress website

Easily integrate Vemetric into your WordPress website.

* * *

WordPress is a popular CMS for building websites.

We published a [WordPress plugin](https://wordpress.org/plugins/vemetric/) that allows you to easily integrate Vemetric into your WordPress website. Follow the steps below to get started.

## Installation

### Install the plugin

You can install the Vemetric Plugin via your Admin Dashboard in WordPress. Navigate to `Plugins` > `Add Plugin` and search for `Vemetric`.

![Screenshot of the WordPress Plugin installation](https://vemetric.com/_astro/wordpress-1.89VE8rkg_2aLe6x.webp)

### Configure your Token

Once you’ve installed the plugin, you can configure your project token in the plugin settings. Navigate to `Settings` > `Vemetric` and enter your project token (found in the settings of your Vemetric project).

![Screenshot of the WordPress Plugin settings](https://vemetric.com/_astro/wordpress-2.B5xF8Gh__AXsz6.webp)

You can also configure all the other settings you see on the Screenshot. Refer to the [HTML Script Docs](https://vemetric.com/docs/sdks/html-script#configuration) for more details about the available options.

### Verify installation

Once you’ve added your token and saved the settings, Vemetric will automatically start tracking page views on your site (each page load will be recorded). You can verify this by checking your Vemetric dashboard for incoming pageview events a few seconds after loading a page.

> Data from `localhost` won’t be tracked.

Keep in mind that one project can be used to track data from multiple websites, which can be useful when you for example want to track users across your landing page and web application. We’ve also created a guide on [how to track data across subdomains](https://vemetric.com/docs/advanced-guides/track-across-subdomains).

### Optional: Track custom events and identify logged-in users

You can either track custom events via data attributes on elements, or by interacting with the `vemetric` object on the `window`.

**Data Attributes**

You can track custom events by adding `data-vmtrc` attributes to any HTML element.

```html
<button data-vmtrc="MyCustomEvent">Click me</button>
```

Look at the [data attributes docs](https://vemetric.com/docs/product-analytics/tracking-custom-events#data-attributes) for more information.

**JavaScript API**

You can also track custom events and identify users by calling the `trackEvent` function on the `vemetric` object available on the `window`.

```ts
await window.vmtrc('trackEvent', 'MyCustomEvent', {
  eventData: { key: 'value' },
}
```

Look at the [HTML Script docs](https://vemetric.com/docs/sdks/html-script#trackevent) for a detailed explanation of the available parameters.

Also learn more about [User Identification](https://vemetric.com/docs/product-analytics/user-identification) to track authenticated users and see their [full journey](https://vemetric.com/docs/product-analytics/user-journeys).

## Further integrations

The WordPress plugin also initiates the [PHP SDK](https://vemetric.com/docs/sdks/php) for tracking events in your PHP code. It exposes a global function `vemetric` which returns a new instance of the Vemetric Client. Here’s an example:

```php
<?php
$vm = vemetric();
$vm->trackEvent('SignupCompleted', [
    'userIdentifier' => 'your-user-identifier',
    'eventData'      => ['plan' => 'Pro'],
    'userData'       => ['setOnce' => ['signupSource' => 'landing-page']],
]);
```
