Skip to content

feat: notify Zapier webhook on installer download clicks - #25

Draft
YouyoungSeo wants to merge 2 commits into
mainfrom
feat/download-webhook-notify
Draft

feat: notify Zapier webhook on installer download clicks#25
YouyoungSeo wants to merge 2 commits into
mainfrom
feat/download-webhook-notify

Conversation

@YouyoungSeo

@YouyoungSeo YouyoungSeo commented Aug 24, 2026

Copy link
Copy Markdown

TL;DR

Adds download tracking for the docs page. When someone downloads AskUI Desktop or AgentOS, we send the event to Zapier, which posts it to our private Slack channel and Google Sheet, including OS type and UTM source. Same webhook the marketing site's /start page already uses.

Open question: the main site has cookie consent, but the docs page doesn't (there wasn't any tracking here at all before this PR). I got around that by reading UTM params straight off the page URL at click time instead of writing anything to cookies or storage, so I don't think this needs a consent banner. That said, this is more of a compliance call than an engineering one, so it'd be good to get a second pair of eyes on it.

Summary

  • Adds a click handler that pings the same Zapier webhook the marketing site's notifyDownload already uses (askui-website's src/lib/tracking.ts), so downloads from docs.askui.com land in the same Slack channel and Google Sheet. This isn't analytics, it just fires every time with no consent gate.
  • lib/tracking.ts has notifyDownload(source, label, os, utm). It builds a FormData payload (JSON would trigger a CORS preflight the Zapier hook can't answer), stamps it with Berlin local time, and sends it with keepalive: true so the request survives the browser navigating away for the download.
  • components/download-link.tsx is a new client component. MDX has no runtime server since this is a static export, so it follows the same pattern run-embed.tsx already uses: a client component registered in components/mdx.tsx. It wraps Card when a title is passed in, otherwise renders a plain <a>. It never calls preventDefault.
  • Swapped in the new component on the 4 pages that link to installers: quickstart.mdx, get-started/install-desktop.mdx, agentos/installation/silent.mdx, and agentos/installation/service.mdx.
  • UTM params (utm_source, utm_medium, utm_campaign, utm_content, utm_term) get read straight from window.location.search when the link is clicked. No session storage, no local storage, no cookies, since UK ICO and EU EDPB guidance treats any of that as needing consent, and this repo doesn't have a consent banner. The tradeoff is that this only catches UTM params if they're on the download page's own URL. If someone picked them up on an earlier page and then navigated over, they won't carry through.

Test plan

  • pnpm install, npx tsc --noEmit, npm run build all pass. Static export builds clean and all 273 pages generate.
  • Clicked through all 4 pages and all 6 download links with Playwright against next dev. The webhook fired exactly once per click every time, with the right source/label/os/timestamp fields, and Content-Type came through as multipart/form-data so there's no preflight.
  • Tested UTM showing up on the download page's own URL (?utm_source=...&utm_medium=...) and confirmed it shows up in the webhook payload.
  • Tested the cross-page case too: landing on a different page with UTM, then navigating to the download page. Confirmed UTM does NOT carry through, which is the accepted tradeoff, not a bug.
  • Confirmed nothing gets written to session storage, local storage, or cookies.
  • Still need someone to click through manually in a real browser against npm run dev (http://localhost:3000/docs-rewrite/docs/quickstart).

YouyoungSeo and others added 2 commits August 24, 2026 16:28
Adds a click handler to the 4 pages that link to AskUI Desktop / AgentOS
installers, pinging the same Zapier catch-hook the marketing site's
notifyDownload uses (feeds the shared Slack channel / Google Sheet
headcount). No cookie-consent gate needed — this is not analytics.

- lib/tracking.ts: notifyDownload + sessionStorage UTM capture/read
- components/download-link.tsx: client wrapper around Card / plain <a>,
  registered in components/mdx.tsx (follows the run-embed.tsx pattern
  since the MDX render tree has no runtime server to attach onClick to)
- components/utm-capture.tsx: mounted in Provider, persists utm_* params
  from the landing URL to sessionStorage so a later download click on a
  different docs page still gets attributed

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Per UK ICO / EU EDPB guidance, writing to any browser storage (session
or local) for marketing/analytics attribution requires consent, and
this repo has no consent banner. Replace the sessionStorage-based UTM
capture with a plain read of the current page's own query string at
the moment the download link is clicked — no storage of any kind.

Tradeoff: a visitor who lands on one docs page via a campaign link and
navigates to a different page before downloading no longer gets
attributed. Only "the download page's own URL carries the UTM params"
is covered now.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@YouyoungSeo

YouyoungSeo commented Aug 25, 2026

Copy link
Copy Markdown
Author

Hey @programminx-askui, quick compliance question before I take this out of draft.

This PR adds a Zapier webhook that fires when someone clicks an AskUI Desktop / AgentOS download link, same idea as what's already live on the marketing site's /start page. Here's what I built:

  • Clicking a download link sends an event to Zapier ( Google Sheet -> Slack notification , same headcount tracking the marketing site already does)
  • UTM params get read straight off the URL the moment someone clicks. Nothing gets written to cookies, sessionStorage, or localStorage
  • No consent banner, since this isn't analytics, it's just a download count and it fires every time

Two things I'd like your take on:

  1. Is there anything here that's actually a compliance problem?
  2. docs.askui.com doesn't link to a privacy policy anywhere right now. Does the main site's policy already cover it since it's the same company, or should we add a link somewhere?

Thanks!

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