feat(deployed): track CTA clicks and 404 landings via Wix analytics - #54
Open
moranshe-max wants to merge 4 commits into
Open
feat(deployed): track CTA clicks and 404 landings via Wix analytics#54moranshe-max wants to merge 4 commits into
moranshe-max wants to merge 4 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Wires
@wix/siteanalytics into the deployed landing page (/deployed/:clientId).data-trackas aCustomEvent(eventCategory: "deployed"): visit-site, open-dashboard, connect-domain, guide, docs.landedevent (live landings aren't tracked).analytics.buttonClicked().Mirrors the analytics pattern already used in
CopyPrompt/TryPrompt— no new dependencies, no client framework, one bundled<script>.Notes
@wix/siteanalyticsis a dispatcher:trackEventforwards 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.registerEventListenercan be used to observe them locally.Test
npm run dev→/deployed/<bogus-id>returns 404 withdata-deployed-state="not-found"anddata-trackattributes present.<script>compiles cleanly; the@wix/siteimport resolves to the same dep bundle the Copy button uses.🤖 Generated with Claude Code