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 in the official WordPress plugin directory. It needs one setting, your site key, and a theme update cannot remove it.
- In your WordPress admin, go to Plugins → Add New.
- Search for ClickLens.
- Click Install Now, then Activate.
- Go to Settings → ClickLens.
- Enter your Site Key from the ClickLens dashboard (Settings → Site Settings) and click Save Changes.
The tracking tag now appears on every page of your site. Confirm it 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.
- In your WordPress admin, go to Appearance → Theme File Editor.
-
Open
header.phpfrom the file list on the right. -
Paste the following snippet just before the closing
</head>tag:
<script>window.clicklens=window.clicklens||function(){(window.clicklens.q=window.clicklens.q||[]).push(arguments)};</script>
<script defer src="https://app.clicklens.io/t.js"
data-site="YOUR_SITE_KEY"
data-cl-token="YOUR_BEACON_TOKEN"
data-endpoint="https://app.clicklens.io/api/v1/beacon">
</script>
Paste both lines. The first is a queue that catches any
clicklens('conversion', …)
call made before the deferred tag has loaded; leave it out and a thank-you page that
converts on load records nothing.
Replace YOUR_SITE_KEY
and YOUR_BEACON_TOKEN
with the values from your ClickLens dashboard. The
installation guide
documents every attribute.
Note: If your theme updates overwrite
header.php, you will
need to re-add the tag. The plugin injects the tag server-side, so a theme update cannot
remove it.
Plugin settings
After activating the plugin, open 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.io.
Only change this if you point the tag at a custom endpoint.
|
Verifying the installation
- Visit your site in a browser (not logged in to WordPress admin).
- Right-click and select View Page Source.
-
Search for
t.js— you should see the ClickLens script tag in the<head>. - 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 about 13 KB gzipped, loads with the
defer attribute
so it never blocks page rendering, and has no measurable 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 other caching plugins.
Does it work with WooCommerce?
Yes. The tag loads on all frontend pages including WooCommerce product, cart, and checkout pages, and the plugin adds WooCommerce-specific features like automatic conversion tracking and page-type detection. See the WooCommerce guide.
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.