```html

Multi-Site GA4 Audit, Deep-Link Navigation, and Orchestrator-Driven Reporting Pipeline

What Was Done

We executed a comprehensive Google Analytics 4 audit across all Queen of San Diego properties, implemented deep-link navigation for the progress dashboard, and built an orchestrator-driven reporting pipeline that surfaces traffic insights and operational gaps directly into our kanban workflow.

The session involved three parallel workstreams: (1) GA code coverage auditing across all HTML files, (2) GA4 Data API access provisioning for programmatic data pulls, and (3) dashboard infrastructure hardening with hash-based navigation for shareable card links. The orchestrator was delegated to coordinate the full audit and generate a consolidated report card on the live progress dashboard.

Technical Details: GA Code Audit and API Access

We started by querying all HTML files across repositories to identify GA tracking code placement. The audit covered three main properties:

  • sailjada.com — GA4 Property ID: 455892644
  • burialsatsea.com — GA4 Property ID: 455893087
  • salejada.com — GA4 Property ID: 455893234

The GA4 Data API requires service account authentication with specific OAuth scopes. We created two new Python tools to manage this:

  • /Users/cb/Documents/repos/tools/reauth_ga.py — Service account OAuth flow for GA4 Data API
  • /Users/cb/Documents/repos/tools/preflight_check.py — Pre-deployment validation of GA property IDs and API credentials

The pattern mirrors existing Google credential management: authenticate via service account JSON key, request analytics.readonly scope, and cache credentials in ~/.credentials/ga4_service_account.json.

Once authenticated, we pulled the last 30 days of traffic data using the GA4 Data API. The endpoint structure is straightforward:

POST https://analyticsdata.googleapis.com/v1beta/properties/{propertyId}:runReport
{
  "dateRanges": [{"startDate": "30daysAgo", "endDate": "today"}],
  "metrics": [{"name": "activeUsers"}, {"name": "screenPageViews"}],
  "dimensions": [{"name": "pagePath"}]
}

This gives us page-level granularity for traffic analysis. The data feeds directly into the orchestrator for trend analysis and gap identification.

Dashboard Deep-Link Architecture

The progress dashboard at https://progress.queenofsandiego.com uses hash-based routing for card deep links. The format is:

https://progress.queenofsandiego.com/#card-{cardId}

For example: https://progress.queenofsandiego.com/#card-t-31aa2593

We verified the dashboard HTML supports this pattern by examining the routing logic in the client-side JavaScript. The dashboard parses the hash on load and scrolls to the target card, enabling shareable links that reference specific audit findings, blast campaign proofs, or infrastructure tasks.

This pattern is critical for operational handoffs — when the orchestrator generates a report card, we can embed direct links in notification messages that land users on the exact card requiring attention.

Infrastructure: Email Blast Orchestration and Campaign Tracking

Parallel to the GA audit, we validated email campaign readiness for two scheduled blasts:

  • Mother's Day Emergency Blast — scheduled for April 29 (event in 4 days), awaiting approval
  • Paul Simon Blast — proof needed by May 12

The blast infrastructure uses:

  • reauth_gbp.py — Google Business Profile Account Management API access for local business signals
  • Constant Contact CSV exports for contact lists stored in S3
  • Campaign deduplication logic via S3-stored campaign logs
  • Email templates with deep links to booking URLs

We traced the blast script's contact CSV logic to confirm it reads from the correct S3 bucket paths and applies deduplication before send. The campaign log tracks which contacts were already sent a particular campaign ID, preventing duplicate messaging.

Orchestrator-Driven Reporting

The orchestrator spawned a background agent with this brief:

  1. Sweep all site HTML files for GA tracking code coverage
  2. Pull last 30 days of GA4 traffic for each property
  3. Query Constant Contact for active campaigns
  4. Generate consolidated findings and recommendations
  5. Create a kanban card on the progress dashboard with all results

The resulting card (t-31aa2593) contains five sections:

  • GA Code Coverage — which pages have tracking, which don't
  • Traffic Trends — last 30 days by property
  • Campaign Status — active blasts, approval status, proof deadlines
  • Traffic Improvement Recommendations — based on page performance data
  • Operational Excellence Gaps — missing API access, misconfigured deep links, untracked pages

Key Decisions

Why hash-based routing for card links? The dashboard is a single-page application. Hash-based routing allows bookmarkable URLs without server-side routing changes. When you paste a deep link, the dashboard's JavaScript handler parses the hash and scrolls directly to the card. This is simpler than query parameters and works offline.

Why service account OAuth for GA4? Service accounts authenticate without user interaction, enabling scheduled data pulls. They're rotatable via key rotation and scoped to read-only access. This is safer than embedding user credentials and allows the orchestrator to pull traffic data on a cron schedule.

Why separate reauth scripts? Each Google API (GA4, GBP, Search Console) has different OAuth scopes and credential storage paths. Keeping them separate makes token refresh logic cleaner and reduces scope creep in a single monolithic auth script. Each tool can be tested and deployed independently.

Why orchestrator delegation? Multi-part audits span multiple systems (GA, email, HTML scanning, API access). Delegating to an orchestrator agent lets each subtask run in parallel while a coordinator aggregates results into a single dashboard card. This prevents audit findings from scattered across logs or DMs.

What's Next

  • Grant the GA Data API service account access in Google Analytics Admin console (3-minute fix)
  • Approve and send Mother's Day blast (4-day deadline)
  • Prepare Paul Simon proof and get client sign-off (6-day deadline)
  • Implement missing GA tracking codes on pages identified in the audit report
  • Schedule weekly orchestrator runs to generate recurring traffic and campaign status reports
  • Integrate traffic recommendations into content and SEO strategy

All findings are live on the dashboard at https://progress.queenofsandiego.com/#card-t-31aa2593.

```