Skip to content

Add community blog: Lighting Up the Black Box: Implementing Privacy-First User Analytics in AMRIT (C4GT 2025) - #37

Open
abhijeetw035 wants to merge 5 commits into
PSMRI:mainfrom
abhijeetw035:add-blog
Open

Add community blog: Lighting Up the Black Box: Implementing Privacy-First User Analytics in AMRIT (C4GT 2025)#37
abhijeetw035 wants to merge 5 commits into
PSMRI:mainfrom
abhijeetw035:add-blog

Conversation

@abhijeetw035

@abhijeetw035 abhijeetw035 commented Nov 10, 2025

Copy link
Copy Markdown

📋 Description

JIRA ID:

This PR adds a new blog post to the AMRIT Website.
The post covers recent updates and insights related to the project, following the existing blog structure and styling.
To publish new content and keep the blog section up to date with the latest information.


✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)
  • New feature (non-breaking change which adds functionality)
  • 🔥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🛠 Refactor (change that is neither a fix nor a new feature)
  • ⚙️ Config change (configuration file or build script updates)
  • 📚 Documentation (updates to docs or readme)
  • 🧪 Tests (adding new or updating existing tests)
  • 🎨 UI/UX (changes that affect the user interface)
  • 🚀 Performance (improves performance)
  • 🧹 Chore (miscellaneous changes that don't modify src or test files)

ℹ️ Additional Information

Testing Done:

  • Verified that the new blog renders correctly on the website
  • Checked formatting, images, and links
image

Summary by CodeRabbit

  • Documentation
    • Added a new blog post describing a privacy-first Matomo analytics implementation: motivation, architecture overview, three-phase rollout, reusable frontend tracking approach, deployment considerations, KPIs and dashboards, impact and learnings, plus visuals to help teams replicate a self-hosted, privacy-preserving analytics setup.

@coderabbitai

coderabbitai Bot commented Nov 10, 2025

Copy link
Copy Markdown

Walkthrough

Adds a new MDX blog post documenting the implementation of privacy-first analytics with Matomo for the AMRIT platform, covering goals, architecture (gateway, NGINX reverse proxy, private Matomo), a reusable TrackingService for Angular UIs, a three-phase rollout, KPIs/dashboards, and lessons learned. No code changes.

Changes

Cohort / File(s) Summary
New Blog Post
src/content/blog/implement-matomo.mdx
Adds a comprehensive MDX post with full front-matter (title, author, date, categories, image, draft, featured) and narrative sections: About Me, Setting the Stage, The Challenge, Designing the Architecture (public gateway, NGINX/reverse proxy, private Matomo server), Building the System (Foundation, Integration, Expansion), reusable TrackingService in Common-UI, KPIs/dashboards, visuals, and learnings.

Sequence Diagram(s)

sequenceDiagram
  participant Browser as Browser (Angular UI)
  participant TrackingSvc as TrackingService (Common-UI)
  participant PublicGW as Public Gateway
  participant NGX as NGINX Gateway / Reverse Proxy
  participant Matomo as Private Matomo Server

  Browser->>TrackingSvc: emit event (pageview / custom)
  TrackingSvc->>PublicGW: send event payload
  Note right of PublicGW `#e6f2ff`: edge layer — rate-limit, TLS
  PublicGW->>NGX: forward request
  Note right of NGX `#f0fff0`: routing, auth, header enforcement
  NGX->>Matomo: deliver tracking request
  Matomo-->>NGX: 2xx / metrics stored
  NGX-->>PublicGW: proxy response
  PublicGW-->>TrackingSvc: ack
  TrackingSvc-->>Browser: complete
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Check front-matter metadata fields for correctness.
  • Verify MDX formatting, headings, code blocks, links, and images.
  • Scan for accidental sensitive infrastructure details.

Suggested reviewers

  • drtechie

Poem

🐰 I nibbled logs and chased a trace,
Through gateways bright and private space,
Matomo hums where metrics sleep,
Quiet hops where data keep,
A little rabbit celebrates the pace.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a new blog post about implementing privacy-first analytics in AMRIT, with relevant context about the topic and event.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25f7f90 and b82b21f.

📒 Files selected for processing (1)
  • src/content/blog/implement-matomo.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/content/blog/implement-matomo.mdx

[uncategorized] ~16-~16: Consider adding a comma here to clarify the structure of the sentence.
Context: ...t impacts real people. ✨ --- ## About Me I'm Abhijeet Waghmare, a **pre-fina...

(PRP_COMMA)


[uncategorized] ~29-~29: Possible missing comma found.
Context: ...ies** across India. But it had one big problem a black box. Despite its scale, AM...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~37-~37: Possible missing comma found.
Context: ...?"** Our tools told us if servers were running not how people used them. And in ...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~92-~92: Possible missing comma found.
Context: ...on the frontend. AMRIT isn't a single app it's a network of Angular-based UIs...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~93-~93: Possible missing article found.
Context: ...etwork of Angular-based UIs**. Adding tracking code manually to each one would've been...

(AI_HYDRA_LEO_MISSING_A)


[uncategorized] ~147-~147: Possible missing comma found.
Context: ...time**.* By the end, the black box was gone replaced by a **clear, measurable, and ...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~153-~153: Possible missing comma found.
Context: ... project was more than just integrating analytics it was a **crash course in scale, secur...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~159-~159: Possible missing comma found.
Context: ...at **great engineering isn't just about code it's about solving real problems for re...

(AI_HYDRA_LEO_MISSING_COMMA)

🔇 Additional comments (2)
src/content/blog/implement-matomo.mdx (2)

1-10: Frontmatter is now compliant with repository conventions.

The frontmatter structure correctly includes all required fields in the expected format:

  • ISO 8601 date with timezone: 2025-11-08T00:00:00Z
  • subtitle field present and descriptive
  • featured: true and draft: false are set appropriately
  • Image path and categories array follow the pattern

This aligns with existing blog posts in the repository.


12-163: Blog post structure and content are well-organized and technically sound.

The narrative flows logically across clear sections (About Me → Setting the Stage → The Challenge → Architecture → Implementation → Impact → Learnings), making it easy to follow. The technical explanations are accurate and appropriately detailed for a developer audience:

  • Server architecture clearly explains the multi-layer setup (public gateway → NGINX → reverse proxy → private Matomo server)
  • TrackingService pattern (lines 89–106) is well-motivated and the code snippet at lines 99–101 concisely shows the intended usage
  • Three-phase rollout narrative (lines 112–125) and KPI discussion (lines 136–145) provide concrete context

The privacy-first framing at line 74 clarifies that while the Matomo dashboard is accessible via DNS for convenience, analytics data remains securely isolated on a private internal server—addressing previous concerns about misunderstanding self-hosting.

The blog post successfully conveys both the engineering journey and the real-world impact for AMRIT's healthcare mission.


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
src/content/blog/implement-matomo.mdx (3)

28-28: Fix missing punctuation between clauses.

Line 28 reads "But it had one big problem a black box." Missing punctuation creates ambiguity. Use an em-dash or colon for clarity.

-But it had one big problem a **black box**.
+But it had one big problem — a **black box**.

48-48: Reconsider bolding mid-sentence question words.

Bolding "why" in "My first thought was why not just use Google Analytics?" is unconventional styling. Consider restructuring to improve readability.

-My first thought was **why** not just use Google Analytics?
+My first thought: **Why not just use Google Analytics?**

52-52: Improve spacing between bold segments.

Line 52 has two consecutive bold phrases: "full data ownership nothing leaves your server." Consider separating with punctuation or restructuring.

-Unlike others, Matomo gives **full data ownership** **nothing leaves your server**.
+Unlike others, Matomo gives **full data ownership** — **nothing leaves your server**.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0723c1d and b94b83b.

⛔ Files ignored due to path filters (9)
  • public/images/posts/abhijeet-c4gt-certificate.jpg is excluded by !**/*.jpg
  • public/images/posts/amrit-repo.png is excluded by !**/*.png
  • public/images/posts/kpis.png is excluded by !**/*.png
  • public/images/posts/matomo-architecture.png is excluded by !**/*.png
  • public/images/posts/matomo-banner.png is excluded by !**/*.png
  • public/images/posts/matomo-dashboard.png is excluded by !**/*.png
  • public/images/posts/matomo.png is excluded by !**/*.png
  • public/images/posts/pull-requests.png is excluded by !**/*.png
  • public/images/posts/server-architecture.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • src/content/blog/implement-matomo.mdx (1 hunks)
🔇 Additional comments (1)
src/content/blog/implement-matomo.mdx (1)

11-173: Content and narrative quality look strong.

The blog post is well-structured, engaging, and effectively communicates the technical implementation while maintaining a personal narrative voice. The progression from problem statement through architecture design to outcomes is logical and compelling. Good use of headings, visuals, and storytelling for a technical blog post.

Comment thread src/content/blog/implement-matomo.mdx Outdated
## The Challenge: Why Analytics in Healthcare Is Hard (and Why We Chose Matomo)

My first thought was **why not just use Google Analytics?**
But **healthcare data is sensitive**, and every click could carry **confidential context**. Sending that to **third-party tools was not an option**.

@drtechie drtechie Nov 10, 2025

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.

This is not correct. Even with Matomo, we shouldn't be sending health data anywhere.
We chose Matomo to remove any third-party dependencies and to host an open-source product in-house.
Anyway this detail can be omitted.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes was Got it . the intent was to highlight our focus on privacy and self hosting, not to imply we track any health-related data. I’ll reword that line accordingly to avoid confusion.

Comment thread src/content/blog/implement-matomo.mdx Outdated

My goal was simple yet crucial **light up that black box**.

![AMRIT GitHub Overview Screenshot](/images/posts/amrit-repo.png)

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.

Quite repetitive and these images are not needed.

Comment thread src/content/blog/implement-matomo.mdx Outdated

#### 🔹 The Server Architecture: Privacy by Design

You can't just expose a Matomo server to the public internet that's a **security risk**.

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.

Meaning?
The matomo URL is still public, right?

@abhijeetw035 abhijeetw035 Nov 10, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Right the Matomo instance is accessible via DNS, but all analytics data resides on a private internal server. I’ll update the line to reflect that clearly. Thanks for catching it!

Comment thread src/content/blog/implement-matomo.mdx Outdated

---

![C4GT Certificate](/images/posts/abhijeet-c4gt-certificate.jpg)

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.

This is needed? 😄

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yeah fine 😄 I took that format from my Medium blog, but I’ll remove it here.

@abhijeetw035

Copy link
Copy Markdown
Author

Made the required changes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/content/blog/implement-matomo.mdx (1)

28-28: Minor: Fix missing commas and articles for grammatical consistency.

The LanguageTool static analysis has flagged several missing commas and one missing article that impact sentence clarity:

Apply this diff to address the grammatical issues:

- But it had one big problem a **black box**.
+ But it had one big problem: a **black box**.

- Our tools told us if servers were running not **how** people used them.
+ Our tools told us if servers were running, not **how** people used them.

- AMRIT isn't a single app it's a **network of Angular-based UIs**.
+ AMRIT isn't a single app; it's a **network of Angular-based UIs**.

- Adding tracking code manually to each one would've been
+ Adding tracking code manually to each one would've been a

- By the end, the black box was gone replaced by a **clear, measurable, and
+ By the end, the black box was gone—replaced by a **clear, measurable, and

- This project was more than just integrating analytics it was a **crash course in scale, secur
+ This project was more than just integrating analytics; it was a **crash course in scale, secur

- Most importantly, I realized that **great engineering isn't just about code it's about solving real problems for re
+ Most importantly, I realized that **great engineering isn't just about code—it's about solving real problems for re

Also applies to: 36-36, 91-91, 146-146, 152-152, 158-158

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b94b83b and 9f3bf71.

📒 Files selected for processing (1)
  • src/content/blog/implement-matomo.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/content/blog/implement-matomo.mdx

[uncategorized] ~15-~15: Consider adding a comma here to clarify the structure of the sentence.
Context: ...t impacts real people. ✨ --- ## About Me I'm Abhijeet Waghmare, a **pre-fina...

(PRP_COMMA)


[uncategorized] ~28-~28: Possible missing comma found.
Context: ...ies** across India. But it had one big problem a black box. Despite its scale, AM...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~36-~36: Possible missing comma found.
Context: ...?"** Our tools told us if servers were running not how people used them. And in ...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~91-~91: Possible missing comma found.
Context: ...on the frontend. AMRIT isn't a single app it's a network of Angular-based UIs...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~92-~92: Possible missing article found.
Context: ...etwork of Angular-based UIs**. Adding tracking code manually to each one would've been...

(AI_HYDRA_LEO_MISSING_A)


[uncategorized] ~146-~146: Possible missing comma found.
Context: ...time**.* By the end, the black box was gone replaced by a **clear, measurable, and ...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~152-~152: Possible missing comma found.
Context: ... project was more than just integrating analytics it was a **crash course in scale, secur...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~158-~158: Possible missing comma found.
Context: ...at **great engineering isn't just about code it's about solving real problems for re...

(AI_HYDRA_LEO_MISSING_COMMA)

🔇 Additional comments (1)
src/content/blog/implement-matomo.mdx (1)

83-83: Image file issue resolved—no action needed.

The image file /images/posts/server-architecture.png is now present in the repository at public/images/posts/server-architecture.png. The blog post will render correctly without broken image links.

Comment thread src/content/blog/implement-matomo.mdx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
src/content/blog/implement-matomo.mdx (1)

1-9: Add missing subtitle field to frontmatter.

The frontmatter is missing the subtitle field, which is required by repository blog post conventions (confirmed in existing blog posts). This must be added to maintain consistency.

Apply this diff to add the subtitle field:

 ---
 title: "Lighting Up the Black Box: Implementing Privacy-First User Analytics in AMRIT (My C4GT 2025 Experience)"
 author: "Abhijeet Waghmare"
+subtitle: "A journey implementing privacy-first analytics with Matomo across AMRIT's healthcare platform"
 date: 2025-11-08T00:00:00Z
 categories: ["Frontend", "Analytics"]
 image: "/images/posts/matomo-banner.png"
 draft: false
 featured: true
 ---
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9f3bf71 and 25f7f90.

📒 Files selected for processing (1)
  • src/content/blog/implement-matomo.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/content/blog/implement-matomo.mdx

[uncategorized] ~15-~15: Consider adding a comma here to clarify the structure of the sentence.
Context: ...t impacts real people. ✨ --- ## About Me I'm Abhijeet Waghmare, a **pre-fina...

(PRP_COMMA)


[uncategorized] ~28-~28: Possible missing comma found.
Context: ...ies** across India. But it had one big problem a black box. Despite its scale, AM...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~36-~36: Possible missing comma found.
Context: ...?"** Our tools told us if servers were running not how people used them. And in ...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~91-~91: Possible missing comma found.
Context: ...on the frontend. AMRIT isn't a single app it's a network of Angular-based UIs...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~92-~92: Possible missing article found.
Context: ...etwork of Angular-based UIs**. Adding tracking code manually to each one would've been...

(AI_HYDRA_LEO_MISSING_A)


[uncategorized] ~146-~146: Possible missing comma found.
Context: ...time**.* By the end, the black box was gone replaced by a **clear, measurable, and ...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~152-~152: Possible missing comma found.
Context: ... project was more than just integrating analytics it was a **crash course in scale, secur...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~158-~158: Possible missing comma found.
Context: ...at **great engineering isn't just about code it's about solving real problems for re...

(AI_HYDRA_LEO_MISSING_COMMA)

🔇 Additional comments (1)
src/content/blog/implement-matomo.mdx (1)

56-143: Verify image count aligns with previous feedback.

The past review noted that images were "quite repetitive and not needed." The current post still includes 6 image references across multiple sections (matomo.png, server-architecture.png, matomo-architecture.png, pull-requests.png, kpis.png, matomo-dashboard.png). Clarify whether this count is intentional or if further reduction is expected per the earlier feedback.

Comment thread src/content/blog/implement-matomo.mdx
@sonarqubecloud

Copy link
Copy Markdown

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