Repository navigation
Description
Summary
Add a Google Search Console integration that works for both HitKeep Cloud and self-hosted deployments.
Problem
HitKeep shows first-party website analytics, but site owners still need to leave the product to understand how visitors discover their site through Google Search. Search Console performance data, such as queries, pages, clicks, impressions, CTR, and average position, is useful context for interpreting traffic changes, content performance, and acquisition quality.
Without an integration, cloud customers and self-hosted operators must compare HitKeep data and Search Console data manually in separate tools. That makes it harder to explain search-driven changes, connect content work to on-site behavior, and keep privacy-first analytics as the central operational view.
Who Benefits
Dashboard users, team admins, managed cloud customers, and self-hosted operators who use HitKeep to understand organic search acquisition and content performance.
Proposed Solution
Add a Google Search Console integration that lets a team connect one or more verified Search Console properties to HitKeep sites, periodically import read-only search performance data, and display it in analytics views.
The first useful version should:
- Support HitKeep Cloud with a managed Google OAuth application.
- Support self-hosted deployments with operator-provided Google OAuth credentials.
- Request read-only Search Console API access.
- Let users map a Google Search Console property to a HitKeep site.
- Import search analytics dimensions that are directly useful in HitKeep, such as date, page, query, country, device, clicks, impressions, CTR, and average position.
- Show imported search metrics in a focused dashboard view and make them available to relevant site-level comparisons.
- Surface sync status, last successful import time, and actionable authorization or quota errors.
- Make connection, property mapping, disconnect, manual sync, scheduled sync, credential, and sync failure operations auditable in HitKeep's audit logs.
User Workflow
- A team admin opens site integrations and chooses Google Search Console.
- HitKeep explains the read-only access being requested and starts the Google OAuth flow.
- The user selects or confirms the Search Console property that maps to the HitKeep site.
- HitKeep records the connection and mapping operation in the relevant audit logs.
- HitKeep imports recent search performance data and keeps it updated on a schedule.
- Dashboard users review search queries, landing pages, clicks, impressions, CTR, and average position alongside HitKeep site analytics.
Success Criteria
- Users can connect and disconnect Google Search Console for a HitKeep site.
- Cloud deployments use managed OAuth credentials without requiring customer-side Google Cloud setup.
- Self-hosted deployments can configure their own OAuth client ID and secret through documented configuration.
- The integration uses the read-only Search Console scope and does not request write access.
- Search Console properties can be mapped to HitKeep sites without crossing team or tenant boundaries.
- Imported data is stored in the tenant data plane and does not require PostgreSQL, Redis, ClickHouse, or an external job system.
- Sync jobs handle token refresh, revoked authorization, quota/rate-limit responses, and partial failures with visible status in the dashboard.
- Connect, disconnect, property mapping changes, manual sync requests, scheduled sync outcomes, credential configuration changes, token refresh failures, revoked authorization, and quota/rate-limit failures are recorded in audit logs with actor, target, outcome, and useful non-sensitive details.
- Team/site-level integration operations appear in the team audit log, and instance/operator-level operations such as self-hosted OAuth credential configuration and background sync failures appear in the instance audit log where applicable.
- Dashboard users can filter search performance by date range and inspect top queries and pages.
- Documentation covers cloud setup, self-hosted setup, privacy expectations, and Google API quota limitations.
- Tests cover API contracts, store behavior, sync error handling, and the main dashboard workflow.
Alternatives Considered
Users can continue opening Google Search Console separately and manually comparing reports with HitKeep analytics. This keeps HitKeep simpler, but it weakens HitKeep's role as the primary analytics workspace and makes routine search-performance analysis slower.
CSV import could avoid OAuth complexity, but it would not provide an ongoing integration, sync status, or a reliable workflow for teams.
Constraints
- Preserve HitKeep's privacy-first posture: import only aggregated Search Console metrics needed for analytics workflows.
- Keep cloud and self-hosted behavior on the same product foundation, with configuration differences only where credentials and operator setup require it.
- Respect tenant boundaries. Do not join control-plane data and tenant analytics data directly.
- Stay compatible with the single-binary runtime and in-process worker model.
- Account for Google Search Console API authorization, token refresh, and usage limits.
- Do not store secrets, refresh tokens, access tokens, or raw authorization payloads in audit log details.
- Use official Google Search Console API behavior as the integration contract:
- Authorization: https://developers.google.com/webmaster-tools/v1/how-tos/authorizing
- Search analytics query API: https://developers.google.com/webmaster-tools/v1/searchanalytics/query
- Usage limits: https://developers.google.com/webmaster-tools/limits
Release Notes
Add Google Search Console integration so teams can connect verified properties and review organic search performance inside HitKeep.
Additional Context
This should be considered a shared cloud and self-hosted feature, not a cloud-only integration. The self-hosted path can require operator-provided Google OAuth credentials, but the dashboard workflow should otherwise feel consistent.
Activity
[-]Add Google Search Console integration for cloud and self-hosted sites[/-][+]Feature: Add Google Search Console integration[/+]feat: Add Google Search Console integration