Skip to main content
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

FeatureDescription
Attribution cookieGenerates and persists cr_attrib UUID (90-day expiry)
CTA link rewritingAppends cr_attrib + UTMs to all CTA destination links
CTA view trackingIntersectionObserver fires when CTA is 50% visible
CTA click trackingEvent delegation captures clicks on [data-cta-id] elements
Event deliveryPosts events directly to WisePilot API (no GTM needed)
GA4 dual-writeFires cta_view/cta_click as GA4 custom events if gtag is present
GHL form injectionInjects hidden cr_attrib field into HighLevel forms
GHL iframe handlingAppends cr_attrib to HighLevel iframe src URLs
RankMath SEOExposes rank_math_title, rank_math_description, rank_math_focus_keyword via REST API
ACF CTA fieldsAuto-creates missing CTA field groups on activation

Installation

Step 1: Download

  1. In WisePilot, go to Integrations -> WordPress
  2. Click Download Plugin
  3. 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

  1. In WordPress admin, go to Plugins -> Add New -> Upload Plugin
  2. Choose the downloaded ZIP file
  3. 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

  1. Visit any page on your site
  2. View page source — search for crConfig. You should see:
    var crConfig = {"websiteId":"your-uuid","eventsUrl":"https://...","trackingToken":"crtkn_..."};
    
  3. Check Network tab — scroll to a CTA and verify a POST to /api/integrations/cr/events fires
  4. 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>
AttributeRequiredDescription
data-cta-idYesUnique CTA identifier
data-cta-positionNoPosition code: abtf, exit, footer, sidebar, in_content
data-asset-content-idNoContent 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.

CTA ID Formats

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:
  1. Go to GA4 -> Admin -> Custom Definitions
  2. Add cta_id as an Event parameter
  3. 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:
EndpointMethodAuthDescription
/wp-json/cr/v1/configurePOSTAdminSets cr_website_id, cr_events_url, cr_tracking_token
/wp-json/cr/v1/statusGETAdminReturns 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

  1. Deactivate and delete the old plugin
  2. Download and install v3.0 from WisePilot
  3. Connect your site to auto-configure
  4. Remove any GTM CTA tracking tags (no longer needed)
  5. Existing tracking data is preserved — new events use cr_plugin source