Skip to main content

Chrome Extension Sync

The HostMetrics Chrome extension provides a one-click alternative to manual CSV downloads. It scrapes trip earnings data directly from Turo’s website and sends it to HostMetrics for import.

What the Extension Does

Instead of downloading a CSV from Turo and uploading it to HostMetrics, the extension:
  1. Reads trip earnings data from the Turo dashboard page
  2. Packages the data in the same format as a Trip Earnings CSV
  3. Sends it to the HostMetrics API for processing
  4. Shows sync progress and results in the extension popup

Installation

The extension can be installed two ways:
  • Chrome Web Store — Install directly from the store listing
  • Manual install — Download the ZIP from HostMetrics and load as an unpacked extension in chrome://extensions
For step-by-step setup, see Chrome Extension Setup.

Sync Flow

User clicks "Sync" in extension popup
→ Content script (turo-earnings.js) scrapes Turo page
→ Data sent to service worker (service-worker.js)
→ Service worker posts to HostMetrics API
→ API runs same import pipeline as CSV upload
→ Extension shows success/error result
  • turo-earnings.js — Scrapes trip earnings data from the Turo earnings page
  • turo-page-interceptor.js — Intercepts Turo API responses for additional data capture
  • hostmetrics-bridge.js — Bridges communication between the Turo page context and the extension
service-worker.js handles the extension lifecycle, manages authentication state, and coordinates data transfer between content scripts and the HostMetrics API.

Progress Tracking

During sync, the extension popup shows:
  • Current step (reading data, sending to server, processing)
  • Progress percentage
  • Number of trips found
  • Estimated time remaining

Error States

ErrorCauseResolution
Turo login requiredUser is not logged in to TuroLog in to Turo in the same browser
Network errorCannot reach HostMetrics APICheck internet connection, verify API URL
No data foundExtension could not find earnings on the pageNavigate to the Turo earnings page first
Import failedServer-side processing errorCheck HostMetrics for error details
The extension requires the user to be on the Turo earnings page (turo.com/us/en/account/earnings) for the scrape to work. The extension popup will prompt navigation if needed.

Last Sync Display

The TuroSyncStatus component on the Data Sources page shows:
  • Last successful sync timestamp
  • Number of trips synced
  • Sync source (extension vs manual CSV)
The ExtensionSyncButton component provides an in-app trigger that communicates with the installed extension.

Extension Files

FilePurpose
chrome-extension/background/service-worker.jsExtension lifecycle and API communication
chrome-extension/content/turo-earnings.jsTuro page scraping logic
chrome-extension/content/turo-page-interceptor.jsAPI response interception
chrome-extension/content/hostmetrics-bridge.jsPage-to-extension bridge
chrome-extension/popup/popup.jsExtension popup UI
chrome-extension/lib/config.jsAPI URL and extension configuration

Security

The extension only accesses Turo pages (declared in the manifest permissions). Data is sent exclusively to the HostMetrics API over HTTPS. No credentials are stored in the extension — it uses the user’s existing Turo browser session.