Skip to content

feat(integrations): Looker Studio Community Connector - #426

Merged
gkhngyk merged 1 commit into
mainfrom
feature/looker-studio-connector
Jul 15, 2026
Merged

gkhngyk merged 1 commit into
mainfrom
feature/looker-studio-connector

Conversation

@gkhngyk

@gkhngyk gkhngyk commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the Looker Studio Community Connector under integrations/looker-studio/ — the consumer side of the Public Metrics API (#422). Agencies open a deployment link, paste their ans_ API key, pick a brand and a metric set, and Ansvisor data lands next to GA4 / Search Console in their dashboards.

  • Code.js — the full connector: KEY auth validated against /api/v1/whoami (key stored in Apps Script UserProperties), a config step with a dynamic brand dropdown (from /api/v1/brands) and a metric-set picker, report-level date range flowing into every request, per-user 5-minute CacheService caching so chart-heavy dashboards don't hammer the API, and friendly user errors for 401/404/5xx.
  • Four metric sets (one data source each):
    Set Dimension Backing endpoint
    Visibility Trend (daily) Date /api/v1/visibility-trend
    Share of Voice by Platform Platform /api/v1/competitor-comparison
    Citations — Top Domains Domain, category /api/v1/citations
    AI Traffic by Platform Platform /api/v1/ai-traffic
  • appsscript.json — manifest with the branding fields the partner gallery will eventually require; urlFetchWhitelist pinned to the cloud web-app origin.
  • README.md — maintainer deploy steps (Apps Script + clasp), agency usage flow, self-host notes (change BASE_URL + whitelist).
  • Docs — new guides/looker-studio.mdx (connect steps, metric sets, GA4 blending recipe) wired into mint.json.

Deployed and verified end-to-end against production: key auth, brand dropdown, and a rendering visibility-trend chart. Google OAuth verification (branding + sensitive-scope review for script.external_request) is in progress separately; until it completes, users pass the "unverified app" interstitial.

Follow-ups

  • Replace the logoUrl (currently the GitHub org avatar) with a hosted square PNG before gallery submission.
  • Partner gallery submission once OAuth verification lands.

Related Issue

Builds on the Public Metrics API from #422.

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🧹 Chore / refactor
  • 📝 Documentation
  • 🚨 Breaking change

How to Test

  1. Create an Apps Script project, paste Code.js + appsscript.json (README has the exact steps), and make a test deployment.
  2. Open the connector link → authorize → paste an ans_... key from Settings → API Keys. A bogus key must be rejected at this step.
  3. Confirm the brand dropdown lists your org's brands; pick one + "Visibility Trend (daily)" → Connect.
  4. Add a time-series chart on Date × Avg Visibility Score with a 30-day range → data matches the dashboard's insights trend.
  5. Repeat with the other three metric sets; each renders its table/chart.
  6. Docs: cd docs && npx mint dev → "Looker Studio" appears under Platform Guides.

Checklist

  • My code follows the project's style guidelines (Prettier clean)
  • I have performed a self-review of my code
  • node --check passes on the connector script; manifest JSON is valid
  • Manually tested end-to-end via a live Apps Script deployment

Apps Script connector over the Public Metrics API (/api/v1) with KEY
auth (ans_ API keys, validated against /api/v1/whoami), a dynamic brand
picker, and four metric sets: daily visibility trend, share of voice by
platform, top citation domains, and AI traffic by platform. Per-user
5-minute response caching keeps chart-heavy dashboards from hammering
the API. Distributed by deployment link for now; the manifest carries
the branding fields the partner gallery will eventually need. Docs gain
a Looker Studio guide wired into the nav.
@gkhngyk
gkhngyk merged commit 743887f into main Jul 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant