Installing Usermaven tracking script on WordPress

In this guide, you will learn about how you can install the Usermaven tracking pixel on your WordPress website.

There are two methods you can use to install the Usermaven tracking code to your WordPress website:

  1. Using the official Usermaven WordPress plugin.
  2. Using third-party WordPress plugin for tracking snippet.

So, let's dive in.

Method 1: Using the Usermaven WordPress plugin (Recommended)

1. Install Usermaven WordPress plugin

Go to your WordPress website and log in. Once logged in, go to the Plugins > Add New. After that search for Usermaven.

Install and activate the WordPress plugin.

2. Configure tracking setup for WordPress plugin

Once the plugin is successfully installed and activated, it's time to configure the tracking setup within the WordPress plugin.

To access the API key, follow these steps:

  1. Log in to your Usermaven account.
  2. Navigate to the Workspace Setup section.
  3. Locate the API key, as demonstrated in the illustration below.

<script src="https://t.usermaven.com/lib.js"
        data-key="API_KEY"
        data-tracking-host="https://events.usermaven.com"
        data-autocapture="true"
        data-privacy-policy="strict"
        defer>
</script>
<script>window.usermaven = window.usermaven || (function(){(window.usermavenQ = window.usermavenQ || []).push(arguments);})</script>;

Copy the API key and paste into API key section. That's it. Now, your WordPress website will start sending important data to your Usermaven workspace.

3. Embed Usermaven dashboard (Optional)

Embed your Usermaven dashboard in your WordPress website to view analytics directly. Simply add the sharable link to the tracking setup.

💡

For Cloudflare Users: Purge your website cache from Cloudflare after you have installed the tracking pixel. Otherwise, the changes will not be reflected. Please follow this link to learn more about purging cache on Cloudflare.

Method 2: Using third-party WordPress plugin

1. Login to your WordPress website

Go to your WordPress website and log in. Once logged in, you need to install a third-party plugin such as WP Code (opens in a new tab) or any other similar WordPress plugin to add tracking pixels.

After the WordPress plugin is installed. On the left side menu, there will be an option for "Code Snippets", Hover on it and select the "Header & Footer" option.

You will see the following screen upon clicking the "Header & Footer" option.

2. Add Usermaven tracking pixel

Now, navigate to your Usermaven account. Head over to the Workspace Settings > Setup.

Copy the Javascript tracking pixel code and paste it into the header section.

Once done, click on the "Save Changes" button. That's it.

💡

For Cloudflare Users: Purge your website cache from Cloudflare after you have installed the tracking pixel. Otherwise, the changes will not be reflected. Please follow this link to learn more about purging cache on Cloudflare.