Skip to main content

Ad bindings (retired)

Retired

This page has been retired. Bindings are now managed inside the ClickUp Audit "Linked Ads" tab.

  • Route: /admin/ad-bindings
  • Guard: /admin/* layout (isAdminTier()); the destination tab's data API additionally enforces platform-admin server-side.
  • Redirects to: /admin/clickup-audit?tab=links — the screenshot below shows that destination.

Admin: Ad Bindings redirect target

What this route is now​

The standalone Ad Linking workspace was merged into the consolidated /admin/clickup-audit page. src/app/admin/ad-bindings/page.tsx is a parameter-preserving redirect: it forwards ?tab= (translated through resolveClickupAuditSection(), which maps legacy tab names like bindings/ad-bindings/linked-ads → links, review-queue → checks), plus ?create=true, ?ad_id=, and ?client_id=, so deep links into "create a binding for this ad" still open the right pre-filled tool. src/app/admin/ad-bindings/tabs.ts keeps the old AdLinkingTab type (requests | links | checks) for backward compatibility.

The "Linked Ads" tab (destination)​

Rendered by AdBindings.tsx inside ClickUpCoveragePanel:

  • Bindings table — up to 500 existing ad→ClickUp-task bindings from GET /api/admin/ad-bindings?limit=500, each row tying an ad_id to a clickup_task_id under a client, with binding source/provenance.
  • Link-an-ad tool — creates a manual binding; the client picker is fed by GET /api/admin/clients?status=active&purpose=ad-linking (active clients only). Opened automatically when arriving with ?create=true&ad_id=….
  • Find-a-link / client filter — search and per-client filtering over the binding list (visible in the screenshot's filter controls).
  • AdBindingDrawer — per-row drawer for inspecting/editing one binding.

Data model and provenance​

Bindings live in the Supabase ad_bindings table. Migration supabase/migrations/052_ad_bindings_v1_import_provenance.sql extended the provenance enum with a v1_import source, so bindings carried over from the legacy V1 system are distinguishable from ones created manually in this UI or automatically by the matcher.

Relation to the bind-ads-to-clickup Inngest job​

Automatic linking is done by the Inngest function src/inngest/functions/bind-ads-to-clickup.ts (function id bind-ads-to-clickup). It fans out a marketing/bind-ads.requested event per client and matches ads to ClickUp tasks; manual bindings made here coexist with its output, and a binding cleared in the audit "Fix & recheck" tab can be re-linked on the next linking run. Coverage of this matching (how many ads have a task at all) is the whole point of the parent ClickUp Audit page (P29).

Behavior summary​

AspectValue
HTTP behaviorServer redirect to /admin/clickup-audit?tab=links
Query paramstab (legacy names resolved), create, ad_id, client_id all preserved
Nav entryNone — the old "Ad Linking" sidebar item was removed; ClickUp Audit (requires manage_clickup) is the entry point
Rendering modeforce-dynamic

Key files​

File / endpointRole
src/app/admin/ad-bindings/page.tsxRedirect with param translation
src/app/admin/ad-bindings/tabs.tsLegacy AdLinkingTab type kept for callers
src/lib/clickup/audit-navigation.tsresolveClickupAuditSection() legacy-tab alias map
src/components/admin/AdBindings.tsxLinked Ads tab UI (table + link tool + drawer)
src/components/admin/AdBindingDrawer.tsxPer-binding drawer
GET/POST /api/admin/ad-bindingsBinding list/create API
GET /api/admin/clients?purpose=ad-linkingClient picker source
src/inngest/functions/bind-ads-to-clickup.tsAutomatic linking job
supabase/migrations/052_ad_bindings_v1_import_provenance.sqlV1-import provenance