> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wisepilot.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting

> Common issues and solutions for the Optimization System.

Common issues and solutions for the Optimization System.

## Attribution Not Working

### Symptoms

* Low join coverage in Data Quality Console
* Form submissions missing `attribution_id`
* CTA clicks not linking to form submissions

### Solutions

1. **Verify Attribution Script is Loaded**
   * Open browser console
   * Check for `window.getAttributionId` function
   * Verify no JavaScript errors

2. **Check Cookie/Storage**
   * Open browser DevTools → Application → Cookies
   * Verify `cr_attrib` cookie exists
   * Check localStorage for `cr_attrib` key

3. **Verify CTA Link Rewriting**
   * Inspect CTA links on page
   * Verify `cr_attrib` parameter is in URL
   * Check that links are being rewritten (idempotent)

4. **Check HighLevel Custom Field**
   * Verify `cr_attrib` custom field exists
   * Verify form hidden field reads from URL parameter
   * Test form submission and check webhook payload

## Low Join Coverage

### Symptoms

* Data Quality Console shows \< 50% join coverage
* Many form submissions without `attribution_id`

### Solutions

1. **Check Coverage By Source Tile**
   * Identify which source is leaking (CTA clicks, form submits, asset resolution)
   * Focus on the lowest percentage

2. **Verify Plugin Event Delivery**
   * Check browser Network tab for POST requests to `/api/integrations/cr/events`
   * Verify `crConfig` appears in page source with populated values
   * Check Data Quality Console -> Freshness for plugin events

3. **Check Form Sources**
   * Some forms may arrive from other sources (not CTAs)
   * This is expected - check "Form Submits (No Prior CTA Click)" tile
   * If high, verify CTA rewrite + plugin tracking is working

## Missing Events

### Symptoms

* No events in Data Quality Console
* Freshness shows "No events"

### Solutions

1. **Check Plugin Events**
   * Verify the WisePilot plugin is activated in WordPress
   * Check browser Network tab for POST requests to `/api/integrations/cr/events`
   * Verify `crConfig` in page source has non-empty `websiteId`, `eventsUrl`, `trackingToken`
   * Check for CORS errors in browser console

2. **Check HighLevel Webhook**
   * Verify webhook is enabled in HighLevel
   * Check webhook URL is correct
   * Verify webhook secret matches
   * Test form submission and check webhook logs

3. **Check API Endpoints**
   * Verify `/api/integrations/cr/events` is accessible (plugin events)
   * Verify `/api/integrations/highlevel/webhook` is accessible
   * Check server logs for errors

## Performance Data Not Updating

### Symptoms

* Asset performance shows zero or stale data
* Rollup job not running

### Solutions

1. **Check Rollup Job**
   * Verify cron job is configured
   * Check job endpoint is accessible
   * Review job logs for errors

2. **Verify Snapshots**
   * Check GA4/GSC snapshots are being created
   * Verify snapshot dates match expected dates
   * Check timezone configuration

3. **Check Asset Resolution**
   * Verify `canonical_path` is set on assets
   * Check Data Quality Console → Coverage → "Form Submits Tied to Asset"
   * If low, verify asset paths match page paths

## Scoring Issues

### Symptoms

* Optimization scores not calculating
* Confidence badges not showing

### Solutions

1. **Check Scoring Rules**
   * Verify scoring rules exist for your objective
   * Check weights sum to 1.0
   * Verify metric keys match metric registry

2. **Check Confidence Calculation**
   * Review join coverage (should be > 50% for medium confidence)
   * Check freshness (should be \< 48 hours for medium confidence)
   * Verify sample size (should be >= 50 for medium confidence)

3. **Verify Performance Data**
   * Check asset\_performance\_daily has data
   * Verify metrics are being aggregated correctly
   * Check for null/zero values
