feat(landing): add analytics events for audience goals - #740
Open
vvtimofeev wants to merge 1 commit into
Open
Conversation
Send a unified `cta` event to the GTM dataLayer (logged to console in dev) and wire it up across the site: - install_copy (ai/manual) — copy install command in Start Creating block - start_creating_view / prompt_copy / tab_switch / howto_start_click — Start Creating block funnel: visibility, AI prompt examples, tabs, hero CTA - theme_export (css/json) — save theme in Themer - icon_download — download SVG from the icon dialog - github_click / figma_open — delegated outbound link tracking (GitHub and Figma links live in page-constructor content, so a global capture-phase listener is used instead of per-component handlers) Matching JS goals are registered in Yandex Metrika counter 94770252; GTM routes the same event to GA4 and Metrika reachGoal. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
vvtimofeev
requested review from
dgaponov,
imsitnikov and
stepanenkoxx
as code owners
August 26, 2026 07:37
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
Adds a unified analytics layer and wires up conversion events across the site, so both Yandex Metrika and GA4 can segment the audience (developers installing, designers, evaluators) instead of only counting page views.
src/utils/analytics.ts— single entry point: pushes actaevent (cta_action+cta_label) to the GTM dataLayer; logs to console in dev.src/hooks/useAnalyticsOutboundLinks.ts— delegated capture-phase listener for outbound GitHub/Figma links (they live in page-constructor content and MDX, so per-component handlers don't scale). Also covers Storybook-style subdomain gaps that GA4 enhanced measurement misses.Events
install_copyai/manualstart_creating_viewprompt_copytab_switchai/manualhowto_start_clickrtlfor RTL landingtheme_exportcss/jsonicon_downloadgithub_clickowner/repofigma_openWiring
Matching JS goals are already registered in Metrika counter 94770252 (identifiers equal
cta_action). To go live, GTM containerGTM-KHT6KD7needs one Custom Event trigger (cta) with two tags: a GA4 event ({{cta_action}}, paramlabel) andym(94770252, 'reachGoal', {{cta_action}}, {label: {{cta_label}}}). In GA4, registercta_labelas an event-scoped custom dimension and mark the key events.Testing
Verified in dev preview via console logging: every event fires with the expected label;
start_creating_viewfires exactly once and only when the block becomes visible.npm run typecheckand ESLint pass; pre-commit lint-staged clean.🤖 Generated with Claude Code