The official Clickport WordPress connector plugin adds the tracking script to every page on your site automatically. Install it, enter your domain, and you are done. No code editing required.
The Clickport Analytics plugin for WordPress handles everything you would otherwise do manually:
<head> of every pageThe plugin requires WordPress 5.0 or later and PHP 7.4 or later. It is lightweight with no external dependencies, and the tracker itself is under 5 KB gzipped.
On activation, the plugin automatically detects your WordPress site's domain (stripping www.) and fills it in for you. The "Exclude admins" option is also enabled by default.
You can also install manually: unzip the file and upload the clickport folder to /wp-content/plugins/ via FTP or your file manager.
The settings page is located at Settings > Clickport Analytics in your WordPress admin. There are two fields:
| Domain |
The domain registered in your Clickport dashboard.
|
|---|---|
| Exclude admins |
The domain that matches your site in the Clickport dashboard. This value is passed as the data-domain attribute on the tracker script. It should match exactly what you registered when adding the site to Clickport (without https:// or www.).
On plugin activation, this field is automatically populated from your WordPress site URL. If your WordPress address is https://www.yoursite.com, the plugin strips the www. prefix and sets the domain to yoursite.com.
When enabled (the default), the plugin skips injecting the tracker script for any logged-in user with the manage_options capability. This means administrators browsing the site will not generate any tracking data.
This is the WordPress equivalent of the "Exclude my IP" feature in the Clickport dashboard, but it works based on your login status rather than IP address. It is especially useful when your IP changes frequently or when multiple admins need to be excluded.
The plugin hooks into WordPress's wp_head action to inject a single script tag into the <head> of every page. Here is exactly what it outputs:
The injection only happens when two conditions are met:
manage_options capabilityThe script is loaded with the defer attribute, so it never blocks page rendering. Visitors will not notice any difference in load time.
After activating the plugin and saving your domain, verify that the tracker is loading correctly.
Visit your site while logged out (or in an incognito window), right-click the page, and select "View Page Source." Search for clickport. You should see the script tag in the <head> section:
Open your browser's developer tools (F12), switch to the Network tab, and reload the page. Filter by "tracker" or "clickport." You should see two requests:
tracker.js loaded from https://clickport.io/tracker.js with a 200 statushttps://clickport.io/api/event (the first pageview)Open your Clickport dashboard and look at the Realtime view. Your visit should appear within 30 seconds. If you have the "Exclude admins" option enabled, make sure you are testing while logged out of WordPress.
If you prefer not to use a plugin, you can add the tracking script manually to your WordPress theme. Open your theme's header.php file (Appearance > Theme File Editor) and paste the snippet inside the <head> tag:
<head>
<!-- Clickport Analytics -->
<script defer data-domain="yoursite.com"
src="https://clickport.io/tracker.js"></script>
<?php wp_head(); ?>
</head>
Alternatively, use a plugin like "Insert Headers and Footers" (WPCode) to inject the snippet without editing theme files.
header.php directly, your changes will be lost when the theme updates. Use a child theme or the Clickport plugin to avoid this.
The WordPress plugin injects a standard tracker script tag with the data-domain attribute. If you need advanced options like API key authentication (data-site), custom API endpoints (cpConfig.api), or 404 detection overrides, you will need to either:
cpConfig script block before the tracker loadsFor most WordPress sites, the default plugin configuration with just the domain is all you need.
If you use a caching plugin (WP Super Cache, W3 Total Cache, LiteSpeed Cache, WP Rocket, etc.), clear your cache after activating the Clickport plugin. Cached pages will not include the tracker until the cache is refreshed.
Also check that your caching plugin is not minifying or combining JavaScript in a way that breaks the tracker. The Clickport script relies on reading its own data-domain attribute, which may not work if the script tag is rewritten during minification.
clickport.io/tracker.js to the exclusion list if you run into issues.
Content Security Policy (CSP) headers or security plugins may block external scripts. If the tracker is not loading, check your browser console for CSP errors. You may need to add https://clickport.io to your site's script-src directive.
The domain in the plugin settings must match the domain registered in your Clickport dashboard. If your WordPress site is at www.yoursite.com but you registered yoursite.com in Clickport, that is fine. The plugin strips the www. prefix automatically. But if the domains are completely different, the tracker will not be able to associate events with your site.
/api/event