The WisePilot WordPress plugin (v3.0+) is the recommended way to deploy attribution tracking and CTA event collection on your site. It replaces the previous GTM-dependent setup with a single plugin that handles everything.
What the Plugin Does
| Feature | Description |
|---|
| Attribution cookie | Generates and persists cr_attrib UUID (90-day expiry) |
| CTA link rewriting | Appends cr_attrib + UTMs to all CTA destination links |
| CTA view tracking | IntersectionObserver fires when CTA is 50% visible |
| CTA click tracking | Event delegation captures clicks on [data-cta-id] elements |
| Event delivery | Posts events directly to WisePilot API (no GTM needed) |
| GA4 dual-write | Fires cta_view/cta_click as GA4 custom events if gtag is present |
| GHL form injection | Injects hidden cr_attrib field into HighLevel forms |
| GHL iframe handling | Appends cr_attrib to HighLevel iframe src URLs |
| RankMath SEO | Exposes rank_math_title, rank_math_description, rank_math_focus_keyword via REST API |
| ACF CTA fields | Auto-creates missing CTA field groups on activation |
Installation
Step 1: Download
- In WisePilot, go to Integrations -> WordPress
- Click Download Plugin
- This generates a ZIP file with your site’s configuration
A tracking token is automatically generated when you download the plugin. This token authenticates event delivery from your site.
Step 2: Install
- In WordPress admin, go to Plugins -> Add New -> Upload Plugin
- Choose the downloaded ZIP file
- Click Install Now, then Activate
Step 3: Connect
When you connect your WordPress site in WisePilot, the app automatically configures the plugin by calling POST /wp-json/cr/v1/configure on your site. This sets:
- Website ID
- Events URL
- Tracking token
No manual configuration is needed.
Step 4: Verify
- Visit any page on your site
- View page source — search for
crConfig. You should see:
var crConfig = {"websiteId":"your-uuid","eventsUrl":"https://...","trackingToken":"crtkn_..."};
- Check Network tab — scroll to a CTA and verify a POST to
/api/integrations/cr/events fires
- Console check — run
window.getAttributionId() to verify the attribution cookie exists
CTA Requirements
For the plugin to track CTA views and clicks, your CTA elements need the data-cta-id attribute:
<div data-cta-id="your-cta-uuid"
data-cta-position="abtf"
data-asset-content-id="CNT-123">
<a href="https://your-booking-page.com">Book a Call</a>
</div>
| Attribute | Required | Description |
|---|
data-cta-id | Yes | Unique CTA identifier |
data-cta-position | No | Position code: abtf, exit, footer, sidebar, in_content |
data-asset-content-id | No | Content ID of the page (CNT-xxx) |
Event Batching
- CTA views are batched with a 1-second debounce (up to 50 per batch)
- CTA clicks flush immediately (before navigation)
- Events are flushed on page unload (
visibilitychange / pagehide)
- Delivery uses
navigator.sendBeacon() with fetch() fallback
View Deduplication
CTA view events are automatically deduplicated per browser session. If a user scrolls past the same CTA multiple times on the same page, or refreshes the page, only one view event is recorded per CTA per session.
Click events are not deduplicated — each click represents an intentional user action and is tracked individually.
The data-cta-id attribute supports two formats:
- UUID — The internal WisePilot CTA ID (used when CTAs are published from WisePilot)
- ACF CTA ID — WordPress ACF field IDs like
cta_footer_1558 (used when CTAs are managed via ACF)
Both formats are accepted. ACF CTA IDs are automatically resolved to the internal UUID on the server side.
GA4 Integration
If GA4 is installed on your site (i.e., window.gtag is available), the plugin automatically fires custom events:
cta_view with parameters: cta_id, cta_position, page_path, attribution_id
cta_click with same parameters
No configuration needed. Events appear in GA4 DebugView immediately and in standard reports after 24-48 hours.
To see CTA data in GA4 reports, register these as Custom Definitions:
- Go to GA4 -> Admin -> Custom Definitions
- Add
cta_id as an Event parameter
- Add
cta_position as an Event parameter
Manual Configuration (Advanced)
If auto-configuration doesn’t work (e.g., WordPress REST API is restricted), you can set config values manually:
Option A: wp-config.php
define('CR_WEBSITE_ID', 'your-website-uuid');
define('CR_EVENTS_URL', 'https://app.contentregistry.com');
define('CR_TRACKING_TOKEN', 'crtkn_your_token');
Option B: WP-CLI
wp option update cr_website_id "your-website-uuid"
wp option update cr_events_url "https://app.contentregistry.com"
wp option update cr_tracking_token "crtkn_your_token"
Plugin REST Endpoints
The plugin registers two REST endpoints:
| Endpoint | Method | Auth | Description |
|---|
/wp-json/cr/v1/configure | POST | Admin | Sets cr_website_id, cr_events_url, cr_tracking_token |
/wp-json/cr/v1/status | GET | Admin | Returns plugin version, config status |
Troubleshooting
crConfig is empty
- Plugin is activated but not yet connected. Go to Integrations -> WordPress in WisePilot and connect your site.
- Or set values manually (see Manual Configuration above).
Events not arriving
- Check browser Network tab for POST requests to the events URL
- Verify the tracking token is valid (matches
wordpress_config.tracking_token in WisePilot)
- Check for CORS errors — the origin must match your
wordpress_config.site_url
Events arrive but CTA data shows zero
- If using ACF-managed CTAs, ensure your CTAs have been synced to WisePilot so the ACF CTA ID (e.g.
cta_footer_1558) can be resolved to the internal UUID. Unmatched ACF IDs are stored with cta_id: null.
Upgrading from v2.x
- Deactivate and delete the old plugin
- Download and install v3.0 from WisePilot
- Connect your site to auto-configure
- Remove any GTM CTA tracking tags (no longer needed)
- Existing tracking data is preserved — new events use
cr_plugin source