pagebridge sync

The main command that syncs Google Search Console data, matches URLs, detects decay, and writes snapshots to Sanity.

Usage

pagebridge sync --site <url> [options]
bash

Options

FlagTypeDescription
--site <url>stringRequired. GSC site URL (e.g., sc-domain:example.com)
--dry-runbooleanPreview what would be synced without writing to the database or Sanity
--skip-tasksbooleanSync data only — skip decay detection and task generation
--check-indexbooleanCheck Google index status for all matched pages via URL Inspection API
--quiet-period <days>numberIgnore content published within this many days (default: 45)
--debugbooleanEnable timing information for each sync phase
--migratebooleanRun database migrations before syncing
--google-service-account <json>stringOverride GOOGLE_SERVICE_ACCOUNT environment variable
--db-url <url>stringOverride DATABASE_URL environment variable
--sanity-project-id <id>stringOverride SANITY_PROJECT_ID environment variable
--sanity-dataset <name>stringOverride SANITY_DATASET environment variable
--sanity-token <token>stringOverride SANITY_TOKEN environment variable
--site-url <url>stringOverride SITE_URL environment variable (your website base URL for URL matching)

Examples

Basic sync

pagebridge sync --site sc-domain:example.com
bash

Full sync with index checking

pagebridge sync --site sc-domain:example.com --check-index --debug
bash

Data only (no tasks)

pagebridge sync --site sc-domain:example.com --skip-tasks
bash

Dry run preview

pagebridge sync --site sc-domain:example.com --dry-run
bash

Run with migrations

pagebridge sync --site sc-domain:example.com --migrate
bash

Output

After a sync completes, you will see a summary including:

  • Total rows processed
  • Number of unique pages found
  • Number of pages matched to Sanity documents
  • Number of unmatched URLs
  • Number of decay signals detected
  • Number of refresh tasks created
  • Index status counts (if --check-index was used)
  • Timing breakdown (if --debug was used)

Unmatched URL diagnostics

Unmatched URLs are stored to the database during sync. After a sync completes, a hint is shown:

Run 'pagebridge diagnose --site <site>' for detailed diagnostics
bash

Use the diagnose command to query stored diagnostics or live-test a specific URL against Sanity.

Data range

By default, the sync fetches data from 90 days ago to 3 days ago. The 3-day offset accounts for the delay in GSC data availability — Google typically takes 2-3 days to finalize search analytics.

Rate limits

When checking index status (--check-index), the CLI rate-limits requests to 100ms between each URL Inspection API call (600 requests per minute). Results are cached for 24 hours to avoid redundant checks.

See also