What the Plugin Does
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 callingPOST /wp-json/cr/v1/configure on your site. This sets:
- Website ID
- Events URL
- Tracking token
Step 4: Verify
- Visit any page on your site
- View page source — search for
crConfig. You should see: - Check Network tab — scroll to a CTA and verify a POST to
/api/integrations/cr/eventsfires - 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 thedata-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()withfetch()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
Thedata-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)
GA4 Integration
If GA4 is installed on your site (i.e.,window.gtag is available), the plugin automatically fires custom events:
cta_viewwith parameters:cta_id,cta_position,page_path,attribution_idcta_clickwith same parameters
- Go to GA4 -> Admin -> Custom Definitions
- Add
cta_idas an Event parameter - Add
cta_positionas 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_tokenin 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 withcta_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_pluginsource