Skip to content

ECHO-233 Add plausible-tracker integration and configuration updates#185

Merged
ussaama merged 2 commits intomainfrom
add-plausible-analytics
Jun 16, 2025
Merged

ECHO-233 Add plausible-tracker integration and configuration updates#185
ussaama merged 2 commits intomainfrom
add-plausible-analytics

Conversation

@ussaama
Copy link
Copy Markdown
Contributor

@ussaama ussaama commented Jun 16, 2025

Summary by CodeRabbit

  • New Features
    • Integrated Plausible analytics for automatic pageview tracking in the app.
    • Added configuration support for customizing the Plausible API host via environment variables.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jun 16, 2025

Walkthrough

Plausible analytics was integrated into the frontend by adding the plausible-tracker dependency, initializing it in the App component, and introducing a configurable API host constant. The analytics setup adapts to different routing contexts and ensures automatic pageview tracking.

Changes

File(s) Change Summary
echo/frontend/package.json Added plausible-tracker v0.3.9 to dependencies.
echo/frontend/src/App.tsx Integrated Plausible analytics: imported tracker, initialized in useEffect, enabled auto pageview tracking, and added cleanup on unmount.
echo/frontend/src/config.ts Added PLAUSIBLE_API_HOST constant, sourced from env or defaulting to Plausible’s endpoint.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant App
    participant PlausibleTracker

    User->>App: Load App component
    App->>PlausibleTracker: Initialize with domain and API host
    App->>PlausibleTracker: enableAutoPageviews()
    Note over App,PlausibleTracker: Auto pageview tracking starts
    User-->>App: Navigates or closes app
    App->>PlausibleTracker: Cleanup analytics tracking on unmount
Loading
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@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: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 50225ee and d658e74.

⛔ Files ignored due to path filters (1)
  • echo/frontend/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • echo/frontend/package.json (1 hunks)
  • echo/frontend/src/App.tsx (1 hunks)
  • echo/frontend/src/config.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
echo/frontend/src/App.tsx (2)
echo/frontend/src/config.ts (4)
  • USE_PARTICIPANT_ROUTER (1-2)
  • PARTICIPANT_BASE_URL (5-6)
  • ADMIN_BASE_URL (3-4)
  • PLAUSIBLE_API_HOST (34-35)
echo/frontend/src/Router.tsx (2)
  • participantRouter (307-347)
  • mainRouter (111-305)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: ci-check-frontend
  • GitHub Check: ci-check-server
🔇 Additional comments (3)
echo/frontend/src/config.ts (1)

34-35: LGTM – sensible default with env override.

Fallback to the public Plausible cloud is clean, no concerns.

echo/frontend/src/App.tsx (1)

25-36: Plausible domain param likely expects a bare host, not a full URL.

ADMIN_BASE_URL / PARTICIPANT_BASE_URL include protocol and potentially path, while Plausible docs specify the naked domain (e.g. app.mycorp.com). Passing a full origin can silently drop events.

-      domain: USE_PARTICIPANT_ROUTER ? PARTICIPANT_BASE_URL : ADMIN_BASE_URL,
+      domain: USE_PARTICIPANT_ROUTER
+        ? new URL(PARTICIPANT_BASE_URL).hostname
+        : new URL(ADMIN_BASE_URL).hostname,

Flag for a quick manual test in the network tab.

echo/frontend/package.json (1)

58-58: Dependency pin looks good – remember to mirror in lockfile.

^0.3.9 aligns with semver-zero semantics (any minor bump is breaking). Keep an eye on changelogs before the next npm update.

@ussaama ussaama changed the title Add plausible-tracker integration and configuration updates ECHO-233 Add plausible-tracker integration and configuration updates Jun 16, 2025
@linear
Copy link
Copy Markdown

linear bot commented Jun 16, 2025

ECHO-233 Add plausible

@ussaama ussaama added this pull request to the merge queue Jun 16, 2025
Merged via the queue into main with commit 2897a3b Jun 16, 2025
5 checks passed
@spashii spashii deleted the add-plausible-analytics branch June 16, 2025 15:04
spashii added a commit that referenced this pull request Nov 18, 2025
…185)

Add plausible-tracker integration and configuration updates

Co-authored-by: Sameer Pashikanti <63326129+spashii@users.noreply.github.com>
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