Agent setup: authorize Sight MCP and ask your agent to call get_tracking_setup. It configures this integration automatically.

Bubble

Sight integration guide for Bubble.io apps.

Part of Sight, split across repos under the sightapp org — see sightapp/sight-backend's SPEC.md for the full picture.

Confirmed from Bubble's docs/forum

  • The only tags Bubble's header injection accepts are <script>, <meta>, and <link> — anything else gets auto-repaired into the body by the browser. A plain <script> tag is exactly what Sight needs, so this is a non-issue here, but worth knowing if you ever add more than the one tag. (Bubble Docs — Page Element)
  • App-wide script/meta injection lives in Settings → SEO / metatags → "Script/meta tags in header" — applies to every page. Per-page injection also exists (page's own HTML header property) if you only want tracking on specific pages.
  • If you're building this as a distributable Bubble plugin (rather than pasting it into one app), the convention analytics plugins use is to wrap a value in _*_ inside the HTML snippet (e.g. _API_KEY_) — Bubble turns that into a plugin setting shown on the app's Plugins tab when installed. (Bubble Forum — dynamic plugin keys)

Install (quick — no plugin, one app)

  1. Go to Settings → SEO / metatags in your Bubble editor.
  2. Under Script/meta tags in header, paste (replace the API key with your project's):
    <script defer src="https://api.usesight.dev/script.js?k=pk_your_project_api_key"></script>
  3. Deploy. Sight's script tracks pageviews automatically, including Bubble's client-side page navigation.

Packaging as a reusable plugin (optional)

If you want a real installable plugin (so the API key is a setting instead of hardcoded per app):

  1. Create a new Bubble plugin (Bubble account → Plugins → Build a plugin), type General/Visual element or a headless element depending on your Bubble plugin editor version.
  2. Add the same script tag as above, but with the key parameterized:
    <script defer src="https://api.usesight.dev/script.js?k=_SIGHT_API_KEY_"></script>
  3. Bubble will surface SIGHT_API_KEY as a plugin field — expose it as a required text field named "Sight API Key" per Bubble's plugin General Settings docs.
  4. Install the plugin into any app and fill in the API key from the Plugins tab, no per-app HTML editing needed.

Tracking custom events

Once the script tag is live, window.analytics.track(name) is available via Bubble's "Run JavaScript" plugin action (from the built-in Toolbox plugin) on any workflow step, e.g. on a form submit:

window.analytics.track("signup");

Verify it worked

Load a live page from your app, then check GET https://api.usesight.dev/api/v1/query/overview?days=1 (with your X-API-Key header) or the Sight dashboard — a pageview should show up within a few seconds.

Source repository