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.
- 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 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.
- 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 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
- 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 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.