feat(format-selector): GA4 ai_format_action events#7215
Merged
Conversation
…ectors copyToClipboard previously swallowed rejections internally, so handleCopyPage's catch never fired and copy_failed events never emitted. Rethrow so the caller's catch sees the failure. Cypress tests: switch to .format-selector__button (the bare button selector matches dropdown buttons too) and stub gtag after page load so GA4's own gtag.js can't overwrite the stub.
Adds the missing connect_mcp Cypress test (the MCP option renders on /influxdb3/core/* per layouts/partials/article/format-selector.html, so the prior 'skip if not configured' note was unjustified). PLAN.md: every run-e2e-specs.js invocation now includes --no-mapping; without it the script exits with 'No file paths provided.' Adds a fallback snippet using a manually-started Hugo + npx cypress for when port 1315 is already occupied.
6 tasks
6 tasks
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.
Summary
Wires
ai_format_actionGA4 events into the format-selector dropdown. Six action values cover all five dropdown options plus the failure path:data-optionactioncopy-pagecopy_page_mdhandleCopyPagesuccesscopy-sectioncopy_section_mdhandleCopySectionsuccessopen-chatgptopen_chatgptopen-claudeopen_claudeconnect-mcp-docsconnect_mcpcopy_failedaction_targetCopy actions emit on outcome (success or catch); external-link actions emit on click since the browser handles navigation after the handler returns.
productis derived via the existinggetProductKeyFromPath()inassets/js/utils/product-mappings.ts.Part A of #7210. Part B (S3 access logs → InfluxDB 3 pipeline for
*.md/*.txtrequest metrics) ships on a separate branch.End-to-end verified in Brave with Tag Assistant against the live GA4 endpoint on
/influxdb3/clustered/: aCopy sectionclick on a page without.mdartifacts produced anai_format_actionhit withaction=copy_failed,action_target=copy_section_md,page_type=branch,product=influxdb3_clustered.Test plan
cypress/e2e/content/llm-format-selector.cy.jspasses (all 6 GA4 tests)copy-page/copy-section)yarn build:ts) clean