```html

Cross-Domain Analytics Audit & Remediation: Unifying GA4 Tracking Across queenofsandiego.com and sailjada.com

Executive Summary

During a comprehensive Google Analytics audit of two interconnected booking properties, we discovered critical session attribution gaps affecting ~60 pages on queenofsandiego.com. The root cause: missing cross-domain linker configuration on outbound links to sailjada.com. This breakdown resulted in session fragmentation, where users clicking from QOS → sailjada.com appeared as "direct" traffic instead of continuing an existing GA session. We remediated the linker gap, deployed missing GA tags on 3 untracked pages, and established a CI/CD pattern to prevent regression.

What Was Done

1. Full Analytics Property Audit

We consolidated tracking across two properties into a single GA4 measurement ID: G-N6HKL4KLKT. The audit revealed:

  • sailjada.com: 22 public pages — all properly instrumented with GA + cross-domain linker
  • queenofsandiego.com: ~82 public pages — GA tag present on 79 pages, but ~60 missing the critical cross-domain linker configuration
  • Missing GA entirely: 3 pages requiring tag injection:
    • /Users/cb/Documents/repos/sites/queenofsandiego.com/charters/index.html
    • /Users/cb/Documents/repos/sites/queenofsandiego.com/charters/nerissa/index.html
    • /Users/cb/Documents/repos/sites/queenofsandiego.com/thank-you/index.html

2. Root Cause Analysis: The Linker Gap

The sailjada.com implementation correctly configured the cross-domain linker:

gtag('config', 'G-N6HKL4KLKT', {
  'linker': {
    'domains': ['queenofsandiego.com', 'www.queenofsandiego.com']
  }
});

However, queenofsandiego.com's gtag config calls lacked this reciprocal configuration. When users clicked links like "View Available Charters" (from QOS → sailjada.com), the GA session ID was not appended to the URL, breaking continuity. This manifested as:

  • Session fragmentation across the two domains
  • Conversions on sailjada.com attributed to "direct" instead of "referral"
  • Inflated bounce rates and underreported cross-domain engagement
  • Broken funnel analysis from inquiry → charter selection → booking

3. Infrastructure Deployment Pattern

Both properties deploy via S3 + CloudFront:

  • queenofsandiego.com apex: S3 bucket queenofsandiego.com → CloudFront distribution (checked via Route53 ALIAS record)
  • www.queenofsandiego.com: S3 bucket www.queenofsandiego.com → CloudFront distribution E2MLBZVR48STAG
  • Rady Shell subdomain: S3 bucket radyshell.queenofsandiego.com → separate CloudFront distribution
  • sailjada.com & www.sailjada.com: Unified S3 bucket with Route53 aliases pointing to shared CloudFront distribution

The salejada.com misspelling was discovered during audit; we created a CloudFront Function to redirect all salejada.com traffic to sailjada.com, preserving user intent and preventing analytics fragmentation from typo-driven bookmarks.

Technical Implementation

Fix Strategy: Automated Multi-Domain Linker Injection

We created three Python scripts to identify, remediate, and validate the linker configuration:

Script 1: Discovery & Audit/tmp/ga_report.py

Parsed all HTML files across both domains, extracted unique gtag config patterns, and generated a structured report of which pages had GA, which had linker config, and which had neither.

Script 2: Automated Remediation/tmp/fix_ga.py

For each QOS HTML file lacking linker config, we:

  • Located the existing gtag('config', 'G-N6HKL4KLKT', {...}) call
  • Injected the 'linker' object with both apex and www variants
  • Applied consistent formatting to preserve HTML structure
  • Added GA tags entirely to the 3 missing-GA pages (injected into <head> section)

Script 3: Validation & Reporting/tmp/cro_report.py

Post-fix, we re-scanned all files to confirm:

  • 100% of QOS pages now have GA + linker
  • Linker domains match across both properties
  • Tag placement consistent in <head> (before other scripts)
  • No syntax errors introduced

Cross-Domain Linker Configuration (Final)

All QOS HTML files now include:

gtag('config', 'G-N6HKL4KLKT', {
  'linker': {
    'domains': ['sailjada.com', 'www.sailjada.com']
  }
});

And sailjada.com reciprocally links back to queenofsandiego.com. This ensures that when a user navigates between domains, the GA session ID is appended as a URL parameter (e.g., ?_gl=1*abc123*...*xyz789), preserving session continuity.

Deployment & Validation

Source Control: All fixes committed to the local repos at /Users/cb/Documents/repos/sites/ and staged for deployment.

CloudFront Invalidations: After S3 sync, we issued invalidation patterns:

  • QOS apex + www: /* (full distribution clear)
  • sailjada.com: /*
  • Rady Shell: targeted invalidation of event pages

Cache Invalidation Timing: CloudFront edge locations typically reflect changes within 60 seconds; we validated live deployment by checking CloudFront function logs and sampling pages via different edge locations.

Key Decisions & Rationale

  • Single GA4 Property vs. Separate: Both domains share G-N6HKL4KLKT because the user journey is fundamentally cross-domain (QOS landing → sailjada.com charter selection → back to QOS checkout). A single property