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

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

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

Option B: WP-CLI

Plugin REST Endpoints

The plugin registers two REST endpoints:

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