Skip to content

feat: add Google Analytics integration to Docusaurus configuration#129

Merged
sanjay-kv merged 2 commits into
recodehive:mainfrom
iitzIrFan:googleanalytics
Jun 20, 2025
Merged

feat: add Google Analytics integration to Docusaurus configuration#129
sanjay-kv merged 2 commits into
recodehive:mainfrom
iitzIrFan:googleanalytics

Conversation

@iitzIrFan

@iitzIrFan iitzIrFan commented Jun 20, 2025

Copy link
Copy Markdown
Member

@sanjay-kv

Solves :- #112

Added analytics ...

@vercel

vercel Bot commented Jun 20, 2025

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the recode Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Jun 20, 2025

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
recode-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2025 2:28pm

@sanjay-kv sanjay-kv requested a review from Copilot June 20, 2025 13:53
@sanjay-kv sanjay-kv added the area:dev-env CI, pre-commit, pylint and other changes that do not change the behavior of the final code label Jun 20, 2025
@sanjay-kv sanjay-kv moved this to In Progress in @recode-web Jun 20, 2025
@sanjay-kv sanjay-kv added this to the recode:launch 3.0 milestone Jun 20, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds Google Analytics integration to the Docusaurus configuration to enable website traffic tracking. Key changes include:

  • Adding the "@docusaurus/plugin-google-analytics" dependency in package.json.
  • Inserting the GA script snippet into docusaurus.config.ts.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
package.json Added GA analytics plugin dependency
docusaurus.config.ts Added manual GA script injection, including debug_mode logic
Comments suppressed due to low confidence (1)

docusaurus.config.ts:23

  • The PR adds the Google Analytics plugin in package.json but then manually injects the GA script in the config; consider using the plugin's prescribed configuration to keep a consistent approach to integration.
  // Google Analytics

Comment thread docusaurus.config.ts
presets: [
[
"classic",
'classic',

Copilot AI Jun 20, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] The presets value changed from double quotes to single quotes; if there's a project-wide style guideline for quoting, standardize the usage for consistency.

Suggested change
'classic',
"classic",

Copilot uses AI. Check for mistakes.
@sanjay-kv

Copy link
Copy Markdown
Member

@iitzIrFan

The build has been failed.

[23:53:26.751] Running build in Washington, D.C., USA (East) – iad1 [23:53:26.751] Build machine configuration: 4 cores, 8 GB [23:53:26.767] Cloning github.com/recodehive/recode-website (Branch: googleanalytics, Commit: 1f7d866) [23:53:28.208] Cloning completed: 1.441s [23:53:29.855] Restored build cache from previous deployment (3JzsF4inngMVkRCMu5pCE1fyprMt) [23:53:30.771] Running "vercel build" [23:53:31.220] Vercel CLI 43.3.0 [23:53:31.821] Warning: Detected "engines": { "node": ">=18.0" } in your package.jsonthat will automatically upgrade when a new major Node.js Version is released. Learn More: http://vercel.link/node-version [23:53:31.825] Installing dependencies... [23:53:37.934] [23:53:37.934] added 17 packages, and changed 1 package in 6s [23:53:37.934] [23:53:37.934] 430 packages are looking for funding [23:53:37.934] runnpm fund for details [23:53:37.983] Running "npm run build" [23:53:38.100] [23:53:38.100] > [email protected] build [23:53:38.100] > docusaurus build [23:53:38.100] [23:53:40.939] [23:53:40.939] [ERROR] Error: "scripts[1]" is invalid. A script must be a plain string (the src), or an object with at least a "src" property. [23:53:40.939] [23:53:40.939] at validateConfig (/vercel/path0/node_modules/@docusaurus/core/lib/server/configValidation.js:330:15) [23:53:40.939] at loadSiteConfig (/vercel/path0/node_modules/@docusaurus/core/lib/server/config.js:40:62) [23:53:40.939] at async Promise.all (index 1) [23:53:40.939] at async loadContext (/vercel/path0/node_modules/@docusaurus/core/lib/server/site.js:39:97) [23:53:40.940] at async getLocalesToBuild (/vercel/path0/node_modules/@docusaurus/core/lib/commands/build/build.js:55:21) [23:53:40.940] at async Command.build (/vercel/path0/node_modules/@docusaurus/core/lib/commands/build/build.js:29:21) [23:53:40.940] at async Promise.all (index 0) [23:53:40.940] at async runCLI (/vercel/path0/node_modules/@docusaurus/core/lib/commands/cli.js:56:5) [23:53:40.940] at async file:///vercel/path0/node_modules/@docusaurus/core/bin/docusaurus.mjs:44:3 [23:53:40.940] [INFO] Docusaurus version: 3.7.0 [23:53:40.940] Node version: v22.16.0 [23:53:40.962] Error: Command "npm run build" exited with 1 [23:53:41.492] [23:53:44.427] Exiting build container

image

Try running run build everytime before push.

@sanjay-kv sanjay-kv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

build fail highlighted

@iitzIrFan

Copy link
Copy Markdown
Member Author

@sanjay-kv

Will inspect and update

@sanjay-kv sanjay-kv merged commit 9bcbc8f into recodehive:main Jun 20, 2025
2 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in @recode-web Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-env CI, pre-commit, pylint and other changes that do not change the behavior of the final code

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants