Skip to content

Algolia, PostHog and Google Analytics#203

Merged
sriramveeraghanta merged 13 commits intomasterfrom
alogolia-and-ga
Feb 5, 2026
Merged

Algolia, PostHog and Google Analytics#203
sriramveeraghanta merged 13 commits intomasterfrom
alogolia-and-ga

Conversation

@danciaclara
Copy link
Collaborator

@danciaclara danciaclara commented Feb 3, 2026

Summary by CodeRabbit

  • New Features

    • Enabled Google Analytics and PostHog; switched site search to Algolia with updated search options.
  • Documentation

    • Revised troubleshooting header and removed an outdated license verification step.
    • Deleted multiple Plane One documentation pages (intro, governance, SSO, workspaces/teams, CLI, deployment, self-host, and related guides).
  • Chores

    • Added site redirect mappings to deployment configuration.

Summary by CodeRabbit

  • New Features

    • Cookie consent banner to manage analytics preferences.
    • Dynamic search: Algolia when configured, otherwise local search.
    • Conditional analytics setup (PostHog injected when configured; Google Analytics included).
  • Documentation

    • Removed several Plane One docs.
    • Reorganized and reformatted multiple self-hosting guides and troubleshooting content.
  • Chores

    • Added example environment file and updated .gitignore for env files.
    • Added URL redirects for improved navigation.

@vercel
Copy link

vercel bot commented Feb 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
developer-docs Ready Ready Preview, Comment Feb 5, 2026 2:59pm

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

Adds environment-driven analytics/search to VitePress, a CookieConsent component injected into the theme Layout, removes multiple Plane One docs, updates self-hosting docs formatting, adds vercel redirects and .env.example, updates .gitignore, and tweaks a troubleshooting header and one bullet.

Changes

Cohort / File(s) Summary
VitePress config
docs/.vitepress/config.mts
Load env vars with CI precedence, compute searchConfig (use Algolia when credentials present, otherwise local), add posthogHead for conditional PostHog script, and include Google Analytics script entries in head. Export signature unchanged.
Theme & CookieConsent
docs/.vitepress/theme/components/CookieConsent.vue, docs/.vitepress/theme/index.ts
Add CookieConsent.vue (localStorage consent, accept/decline handlers that toggle gtag/PostHog) and inject it into the theme Layout bottom slot via a new Layout() render.
Env & ignores
.env.example, .gitignore
Add .env.example with PostHog/Algolia placeholders; add ignore patterns for .env, .env.local, and .env.*.local to .gitignore.
Vercel redirects
vercel.json
Add a redirects array with source→destination mappings while preserving cleanUrls.
Plane One docs removed
docs/plane-one/...
docs/plane-one/governance/authentication/custom-sso.md, docs/plane-one/governance/workspaces-and-teams.md, docs/plane-one/introduction.md, docs/plane-one/manage/advanced-deploy.md, docs/plane-one/manage/prime-cli.md, docs/plane-one/manage/prime-client.md, docs/plane-one/self-host/guides.md, docs/plane-one/self-host/methods/docker.md, docs/plane-one/self-host/methods/kubernetes.md, docs/plane-one/self-host/overview.md
Remove multiple Plane One documentation pages covering SSO, workspaces/teams, introductions, management guides, and self-host deployment guides.
Troubleshooting header change
docs/self-hosting/troubleshoot/license-errors.md
Rename header to "Errors related to licenses" and remove one troubleshooting bullet that suggested running prime-cli restart.
Self-hosting docs formatting
docs/self-hosting/...
configure-dns-email-service.md, custom-domain.md, methods/coolify.md, methods/portainer.md, upgrade-from-community.md
Editorial and formatting adjustments: code fence languages, reflowed examples, step renumbering, improved warnings and consistent indentation; no functional changes to instructions.
Misc docs edits
docs/.vitepress/config.mts (head/search reference)
Replace static search config with computed searchConfig and spread conditional posthogHead into head along with GA scripts.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Browser
  participant CookieConsent as CookieConsent.vue
  participant Analytics as Analytics (gtag / PostHog)

  Browser->>CookieConsent: mount()
  CookieConsent->>Browser: read localStorage (plane-docs-cookie-consent)
  alt stored = granted
    CookieConsent->>Analytics: enable gtag & init PostHog (if key present)
  else stored = denied
    CookieConsent->>Analytics: ensure PostHog disabled, gtag not permitted
  else no decision
    CookieConsent->>Browser: show banner (Accept / Decline)
    User->>CookieConsent: click Accept
    CookieConsent->>Browser: write localStorage = granted
    CookieConsent->>Analytics: init/enable analytics
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I hopped through configs with a curious zap,
Pinned gtag and PostHog on the VitePress map,
Tucked search behind env keys — Algolia or local,
Shelved old Plane One pages, trimmed the doc vocal,
Rolled redirects out and curled up for a nap.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Algolia, PostHog and Google Analytics' directly corresponds to the main technical changes: environment-driven analytics setup, PostHog integration, Google Analytics configuration, and Algolia search implementation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch alogolia-and-ga

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@docs/.vitepress/config.mts`:
- Around line 48-53: Gate Google Analytics initialization behind explicit user
consent: modify the two script entries that inject gtag (the ['script', ...]
entries and the inline gtag setup invoking gtag('config')) to first set consent
defaults to denied (use gtag('consent', 'default', {ad_storage:'denied',
analytics_storage:'denied'})) and remove or delay the gtag('config') call;
implement a consent callback (or expose a function like enableGtagConsent())
that upon user opt-in calls gtag('consent','update', {ad_storage:'granted',
analytics_storage:'granted'}) and then calls gtag('config', 'G-JF828SKW90') so
analytics are only configured after consent.
🧹 Nitpick comments (1)
docs/.vitepress/config.mts (1)

631-637: Algolia search-only keys are designed to be publicly committed; consider env injection for easier rotation.

This appears to be a search-only API key (correct for a public docs search provider). Algolia and DocSearch explicitly state that search-only keys are safe to share publicly, including in git. However, using an environment variable (process.env.ALGOLIA_SEARCH_KEY) would simplify future rotation without requiring a git commit. This is optional rather than urgent.

♻️ Env-injected key (optional)
       options: {
         appId: 'AXICJJC8RP',
-        apiKey: '23df4157dee1d9a8d435cadd6cae3f26',
+        apiKey: process.env.ALGOLIA_SEARCH_KEY ?? '23df4157dee1d9a8d435cadd6cae3f26',
         indexName: 'plane_developer_docs',
         searchParameters: {
           facetFilters: []
         },
         insights: true,

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@docs/.vitepress/config.mts`:
- Line 31: The config sets lang: 'root', which is not a valid BCP 47 tag and
will produce improper <html lang="">; update the exported VitePress config
object (the lang property) to a valid BCP 47 tag such as 'en' or 'en-US' (e.g.,
replace 'root' with 'en' or 'en-US') so screen readers and SEO receive a correct
language attribute.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@docs/.vitepress/config.mts`:
- Around line 628-635: The Algolia credentials are hardcoded in the
search.options object (appId and apiKey) — replace the literal values for appId
and apiKey with environment variables (e.g., read from process.env or Vite's
import.meta.env) so search.options.appId and search.options.apiKey pull from
ALGOLIA_APP_ID and ALGOLIA_SEARCH_KEY at build time; keep indexName and insights
as-is, update docs/deployment settings to declare those env vars
(ALGOLIA_APP_ID, ALGOLIA_SEARCH_KEY) and ensure CI/Vercel build config injects
them for production builds.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@vercel.json`:
- Around line 52-59: Duplicate redirect entries for source
"/plane-one/manage/advanced-deploy" -> "/self-hosting/overview" exist in
vercel.json; remove one of the identical redirect objects so only a single
mapping remains, and ensure the redirects array stays valid JSON (no stray
trailing commas) after deletion.

@danciaclara danciaclara changed the title Algolia and GA Algolia, PostHog and GA Feb 4, 2026
@danciaclara danciaclara changed the title Algolia, PostHog and GA Algolia, PostHog and Google Analytics Feb 4, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@docs/.vitepress/config.mts`:
- Around line 55-59: The PostHog project key is hardcoded in the inline script
(the ['script', {}, `... posthog.init('phc_...') ...`] entry) which prevents
rotation and bypasses consent; change posthog.init to read the key from an
environment variable (e.g., POSTHOG_KEY via import.meta.env or the existing env
loader used in config.mts) and add the same consent gating logic you use for
Google Analytics so the initialization only runs when analytics consent is
given; update deployment docs to document POSTHOG_KEY alongside Algolia vars and
ensure the change touches the inline script block and the posthog.init call.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Fix all issues with AI agents
In @.env.example:
- Around line 4-7: The dotenv-linter complains about unsorted keys in
.env.example; reorder the Algolia variables VITE_ALGOLIA_APP_ID,
VITE_ALGOLIA_API_KEY, and VITE_ALGOLIA_INDEX_NAME into alphabetical order (or
the project’s required ordering) so the three entries are sorted consistently in
the file; update the block containing those symbols so the linter no longer
flags them.

In `@docs/self-hosting/govern/custom-domain.md`:
- Around line 91-93: Replace the inline backticked snippet that currently shows
"`bash    sudo prime-cli restart`" with a proper fenced code block: add a
opening fence with ```bash before the command and a closing ``` after it so the
line containing "sudo prime-cli restart" is rendered as a bash code block;
update the markdown around the existing snippet that references `bash` and `sudo
prime-cli restart` accordingly.

In `@docs/self-hosting/methods/coolify.md`:
- Line 20: The heading contains a typo: change the phrase "Download the required
depoyment files" to "Download the required deployment files" in the
docs/self-hosting/methods/coolify.md content so the word "depoyment" is
corrected to "deployment" in that list item; update the markdown text
accordingly.

In `@docs/self-hosting/upgrade-from-community.md`:
- Around line 95-107: The env block under "Configure object storage" (the
`#DATASTORE SETTINGS` section) is malformed and breaking Markdown linting; wrap
the environment variables in a proper fenced code block by starting with
"```env" before USE_MINIO and ending with "```" after AWS_S3_BUCKET_NAME, then
place the info callout (`:::info` ... `:::`) on its own lines after that closing
fence so the callout is rendered correctly; ensure there is a blank line between
the closing ``` and the `:::info` callout for proper parsing.
- Around line 51-73: The fenced code blocks containing the single-line "cd
~/ce-backup" and the multi-line shell script beginning with
"TARGET_DIR=/opt/plane/data" should include a language identifier for Markdown
linting and readability; update the opening backticks from ``` to ```bash for
both blocks so they become ```bash cd ~/ce-backup ```bash and ```bash
(script...) ```bash respectively, leaving the block contents unchanged and
preserving the closing triple backticks.
🧹 Nitpick comments (1)
docs/.vitepress/theme/components/CookieConsent.vue (1)

70-79: Set explicit button types to avoid accidental form submits.
If the banner ever renders inside a form, default submit behavior could fire.

Suggested tweak
-        <button class="consent-btn consent-btn-decline" `@click`="decline">Decline</button>
-        <button class="consent-btn consent-btn-accept" `@click`="accept">Accept</button>
+        <button type="button" class="consent-btn consent-btn-decline" `@click`="decline">Decline</button>
+        <button type="button" class="consent-btn consent-btn-accept" `@click`="accept">Accept</button>

Comment on lines +4 to +7
# Algolia Search
VITE_ALGOLIA_APP_ID=
VITE_ALGOLIA_API_KEY=
VITE_ALGOLIA_INDEX_NAME=
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Reorder Algolia keys to satisfy dotenv-linter.

Proposed fix
 # Algolia Search
-VITE_ALGOLIA_APP_ID=
 VITE_ALGOLIA_API_KEY=
+VITE_ALGOLIA_APP_ID=
 VITE_ALGOLIA_INDEX_NAME=
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Algolia Search
VITE_ALGOLIA_APP_ID=
VITE_ALGOLIA_API_KEY=
VITE_ALGOLIA_INDEX_NAME=
# Algolia Search
VITE_ALGOLIA_API_KEY=
VITE_ALGOLIA_APP_ID=
VITE_ALGOLIA_INDEX_NAME=
🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 6-6: [UnorderedKey] The VITE_ALGOLIA_API_KEY key should go before the VITE_ALGOLIA_APP_ID key

(UnorderedKey)

🤖 Prompt for AI Agents
In @.env.example around lines 4 - 7, The dotenv-linter complains about unsorted
keys in .env.example; reorder the Algolia variables VITE_ALGOLIA_APP_ID,
VITE_ALGOLIA_API_KEY, and VITE_ALGOLIA_INDEX_NAME into alphabetical order (or
the project’s required ordering) so the three entries are sorted consistently in
the file; update the block containing those symbols so the linter no longer
flags them.

### Procedure

1. **Download the required depoyment files**
1. **Download the required depoyment files**
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix typo: “depoyment” → “deployment”.

Proposed fix
-1. **Download the required depoyment files**
+1. **Download the required deployment files**
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. **Download the required depoyment files**
1. **Download the required deployment files**
🤖 Prompt for AI Agents
In `@docs/self-hosting/methods/coolify.md` at line 20, The heading contains a
typo: change the phrase "Download the required depoyment files" to "Download the
required deployment files" in the docs/self-hosting/methods/coolify.md content
so the word "depoyment" is corrected to "deployment" in that list item; update
the markdown text accordingly.

Comment on lines 51 to 73
1. Start any command-line interface like Terminal and go into the folder with the back-up files.
```
cd ~/ce-backup
```
```
cd ~/ce-backup
```
2. Copy and paste the script below on Terminal and hit Enter.
```
TARGET_DIR=/opt/plane/data
sudo mkdir -p $TARGET_DIR
for FILE in *.tar.gz; do
if [ -e "$FILE" ]; then
tar -xzvf "$FILE" -C "$TARGET_DIR"
else
echo "No .tar.gz files found in the current directory."
exit 1
fi
done

mv $TARGET_DIR/pgdata/ $TARGET_DIR/db
mv $TARGET_DIR/redisdata/ $TARGET_DIR/redis
mkdir -p $TARGET_DIR/minio
mv $TARGET_DIR/uploads/ $TARGET_DIR/minio/uploads/
```

```
TARGET_DIR=/opt/plane/data
sudo mkdir -p $TARGET_DIR
for FILE in *.tar.gz; do
if [ -e "$FILE" ]; then
tar -xzvf "$FILE" -C "$TARGET_DIR"
else
echo "No .tar.gz files found in the current directory."
exit 1
fi
done

mv $TARGET_DIR/pgdata/ $TARGET_DIR/db
mv $TARGET_DIR/redisdata/ $TARGET_DIR/redis
mkdir -p $TARGET_DIR/minio
mv $TARGET_DIR/uploads/ $TARGET_DIR/minio/uploads/
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add language identifiers to fenced code blocks.

This addresses MD040 and improves readability.

Proposed fix
-   ```
-   cd ~/ce-backup
-   ```
+   ```bash
+   cd ~/ce-backup
+   ```-   ```
+   ```bash
     TARGET_DIR=/opt/plane/data
     sudo mkdir -p $TARGET_DIR
     for FILE in *.tar.gz; do
         if [ -e "$FILE" ]; then
             tar -xzvf "$FILE" -C "$TARGET_DIR"
         else
             echo "No .tar.gz files found in the current directory."
             exit 1
         fi
     done
…
-   ```
+   ```
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. Start any command-line interface like Terminal and go into the folder with the back-up files.
```
cd ~/ce-backup
```
```
cd ~/ce-backup
```
2. Copy and paste the script below on Terminal and hit Enter.
```
TARGET_DIR=/opt/plane/data
sudo mkdir -p $TARGET_DIR
for FILE in *.tar.gz; do
if [ -e "$FILE" ]; then
tar -xzvf "$FILE" -C "$TARGET_DIR"
else
echo "No .tar.gz files found in the current directory."
exit 1
fi
done
mv $TARGET_DIR/pgdata/ $TARGET_DIR/db
mv $TARGET_DIR/redisdata/ $TARGET_DIR/redis
mkdir -p $TARGET_DIR/minio
mv $TARGET_DIR/uploads/ $TARGET_DIR/minio/uploads/
```
```
TARGET_DIR=/opt/plane/data
sudo mkdir -p $TARGET_DIR
for FILE in *.tar.gz; do
if [ -e "$FILE" ]; then
tar -xzvf "$FILE" -C "$TARGET_DIR"
else
echo "No .tar.gz files found in the current directory."
exit 1
fi
done
mv $TARGET_DIR/pgdata/ $TARGET_DIR/db
mv $TARGET_DIR/redisdata/ $TARGET_DIR/redis
mkdir -p $TARGET_DIR/minio
mv $TARGET_DIR/uploads/ $TARGET_DIR/minio/uploads/
```
1. Start any command-line interface like Terminal and go into the folder with the back-up files.
🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

[warning] 52-52: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 57-57: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In `@docs/self-hosting/upgrade-from-community.md` around lines 51 - 73, The fenced
code blocks containing the single-line "cd ~/ce-backup" and the multi-line shell
script beginning with "TARGET_DIR=/opt/plane/data" should include a language
identifier for Markdown linting and readability; update the opening backticks
from ``` to ```bash for both blocks so they become ```bash cd ~/ce-backup
```bash and ```bash (script...) ```bash respectively, leaving the block contents
unchanged and preserving the closing triple backticks.

@sriramveeraghanta sriramveeraghanta merged commit 40ff374 into master Feb 5, 2026
3 checks passed
@sriramveeraghanta sriramveeraghanta deleted the alogolia-and-ga branch February 5, 2026 15:06
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