Docs / WordPress

WordPress Integration

Install ClickLens on any WordPress site in under two minutes.

Option 1: Install from the plugin directory (recommended)

The ClickLens plugin is available in the official WordPress plugin directory. This is the easiest way to get started.

  1. In your WordPress admin, go to Plugins → Add New.
  2. Search for ClickLens.
  3. Click Install Now, then Activate.
  4. Go to Settings → ClickLens.
  5. Enter your Site Key from the ClickLens dashboard (Settings → Site Settings) and click Save Changes.

The tracking tag will now appear on every page of your site. You can verify it's working by viewing the page source and searching for clicklens.

Option 2: Manual installation via header.php

If you prefer not to use a plugin, you can add the tag directly to your theme.

  1. In your WordPress admin, go to Appearance → Theme File Editor.
  2. Open header.php from the file list on the right.
  3. Paste the following snippet just before the closing </head> tag:
<script defer src="https://app.clicklens.com/t.js"
  data-site="YOUR_SITE_KEY"
  data-endpoint="https://app.clicklens.com/api/v1/beacon">
</script>

Replace YOUR_SITE_KEY with the site key from your ClickLens dashboard.

Note: If your theme updates overwrite header.php, you will need to re-add the tag. Using the plugin avoids this issue.

Plugin settings

After activating the plugin, navigate to Settings → ClickLens to configure it.

Setting Description
Site Key Your unique site identifier, found in the ClickLens dashboard under Settings → Site Settings. Required.
Endpoint URL The ClickLens server URL. Defaults to https://app.clicklens.com. Only change this if you are self-hosting.

Verifying the installation

  1. Visit your site in a browser (not logged in to WordPress admin).
  2. Right-click and select View Page Source.
  3. Search for t.js — you should see the ClickLens script tag in the <head>.
  4. In the ClickLens dashboard, go to Sessions. Within a few minutes, your visit should appear as a new session.

Requirements

  • WordPress 5.0 or higher
  • PHP 7.4 or higher
  • A ClickLens account with an active site

FAQ

Will the plugin slow down my site?

No. The tracking tag is under 5 KB gzipped, loads with the defer attribute so it never blocks page rendering, and has zero impact on Core Web Vitals.

Does it work with caching plugins?

Yes. The tag is injected server-side before the page is cached, so it works with WP Super Cache, W3 Total Cache, LiteSpeed Cache, and all other caching solutions.

Does it work with WooCommerce?

Yes. The tag loads on all frontend pages including WooCommerce product, cart, and checkout pages. WooCommerce-specific features like automatic conversion tracking are coming soon.

What happens if I deactivate the plugin?

The tracking tag stops loading immediately. Your existing data in ClickLens is preserved. Uninstalling the plugin removes its settings from the WordPress database.