Skip to content

feat(deployed): track CTA clicks and 404 landings via Wix analytics - #54

Open
moranshe-max wants to merge 4 commits into
mainfrom
saber-sundial
Open

feat(deployed): track CTA clicks and 404 landings via Wix analytics#54
moranshe-max wants to merge 4 commits into
mainfrom
saber-sundial

Conversation

@moranshe-max

Copy link
Copy Markdown
Collaborator

What

Wires @wix/site analytics into the deployed landing page (/deployed/:clientId).

  • A delegated click listener reports every CTA tagged with data-track as a CustomEvent (eventCategory: "deployed"): visit-site, open-dashboard, connect-domain, guide, docs.
  • The 404 state reports a landed event (live landings aren't tracked).
  • The Copy-prompt button keeps its existing analytics.buttonClicked().

Mirrors the analytics pattern already used in CopyPrompt/TryPrompt — no new dependencies, no client framework, one bundled <script>.

Notes

@wix/site analytics is a dispatcher: trackEvent forwards to external analytics tools connected to the site (GA4 / Meta Pixel / GTM) — it does not populate a built-in Wix dashboard. Events only surface once a tool is connected. registerEventListener can be used to observe them locally.

Test

  • npm run dev/deployed/<bogus-id> returns 404 with data-deployed-state="not-found" and data-track attributes present.
  • Inline <script> compiles cleanly; the @wix/site import resolves to the same dep bundle the Copy button uses.
  • Live state (cards + visit/dashboard tracking) needs a real client id to exercise.

🤖 Generated with Claude Code

moranshe-max and others added 4 commits June 22, 2026 15:56
Wire @wix/site analytics into the deployed page. A delegated click
listener reports every CTA tagged with data-track (visit-site,
open-dashboard, connect-domain, guide, docs) as a CustomEvent, and the
404 state reports a "landed" event. Mirrors the existing
analytics.buttonClicked() pattern on the Copy button.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…Event

CTA clicks now report analytics.buttonClicked() instead of a CustomEvent,
matching the Copy button. The 404 landing keeps its CustomEvent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the global document click delegation with a
querySelectorAll("[data-track]").forEach(...) per-element binding,
matching the existing pattern in components/xray/Layer.tsx.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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