Skip to content

fix: update analytics script configuration#807

Open
slayerjain wants to merge 1 commit intomainfrom
fix/update-analytics
Open

fix: update analytics script configuration#807
slayerjain wants to merge 1 commit intomainfrom
fix/update-analytics

Conversation

@slayerjain
Copy link
Member

Summary

  • Add updated analytics script to improve site usage tracking

Test plan

  • Verify docs site builds successfully
  • Verify script loads correctly on docs pages

🤖 Generated with Claude Code

Add updated analytics script to improve site usage tracking.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 26, 2026 13:04
@kilo-code-bot
Copy link

kilo-code-bot bot commented Mar 26, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Overview

This PR adds a new telemetry analytics script configuration to the Docusaurus config. The change is minimal and follows the existing patterns in the codebase.

Note: The new script uses async: true without defer: true, which differs from other scripts in the file (e.g., feedback.js, clarity.js, apollo-init.js all use both). This may be intentional for telemetry timing purposes, but if consistency is preferred, consider adding defer: true as well.

Files Reviewed (1 file)
  • docusaurus.config.js - 0 issues

Reviewed by claude-4.5-opus-20251124 · 74,609 tokens

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Docusaurus site configuration to add a new client-side telemetry/analytics script for improved docs usage tracking.

Changes:

  • Add a new remote telemetry script (telemetry.keploy.io) to the scripts array.
  • Configure the telemetry script via data-* attributes (data-endpoint, data-source).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

},
{
src: "https://telemetry.keploy.io/sessions/sdk.js",
async: true,
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new script entry is the only one in the scripts array that does not set defer: true (the other active entries at ~366–381 set both async and defer). If the intention is to keep consistent script loading behavior/order across the site, add defer: true here as well (or align all script entries to a single pattern).

Suggested change
async: true,
async: true,
defer: true,

Copilot uses AI. Check for mistakes.
src: "https://telemetry.keploy.io/sessions/sdk.js",
async: true,
"data-endpoint": "https://telemetry.keploy.io/sessions/collect",
"data-source": "docs",
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loading an unpinned third-party script from a remote origin can introduce supply-chain risk and makes behavior changes possible without a deploy (the script can change server-side). Consider pinning to a versioned/static asset and/or using Subresource Integrity (integrity + crossorigin) or self-hosting the script if supported by the telemetry provider.

Suggested change
"data-source": "docs",
"data-source": "docs",
// NOTE: Replace the integrity value below with the actual SRI hash for
// https://telemetry.keploy.io/sessions/sdk.js, computed via a trusted tool.
integrity: "sha384-REPLACE_WITH_REAL_SRI_HASH",
crossorigin: "anonymous",

Copilot uses AI. Check for mistakes.
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.

2 participants