1
0 Comments

How I Used Firebase and a "Watcher" Script to Bring a Live Community Heartbeat to My Exam Platform

From Static Proof to a Live Community Pulse

I created SEOSiri for a simple reason: I believe true expertise deserves recognition. In a field that changes so rapidly, it's not enough to just know your craft—you need to be able to prove it. Our free exam system was built to be that proof, a challenging benchmark to validate real-world skills. But as I watched thousands of you engage with the material, I realized a crucial element was missing. The experience felt static. You took an exam, but you couldn't feel the pulse of the community taking it alongside you.

Today, that changes. We've rolled out a permanent, live, lifecycle participation counter for every single exam on SEOSiri. This isn't just a number; it's the heartbeat of our learning community, and this is the story of why—and how—we built it.

The Problem: The Loneliness of a Certificate

The world of online learning is dominated by incredible platforms like Coursera, Udemy, and LinkedIn Learning. They offer world-class courses that result in a certificate of completion, which is fantastic for showing you’ve completed a curriculum.

But a certificate doesn't show you were one of a thousand people who tested their skills this week. It doesn't capture the momentum of a global community all striving for mastery at the same time. We didn't want to just offer exams; we wanted to build a stadium. We wanted you to feel the energy of the crowd, to know that as you tackle a difficult question, hundreds of others have been there before you. This is social proof, motivation, and credibility all rolled into one.

The Solution: A Dev-Centric Approach to Building Trust

We decided to build a counter that embodies trust and transparency. It needed to be:

  • Permanent: Tracks the exam's entire lifecycle, from the first participant to the ten-thousandth.
  • Live: Updates in real-time to reflect a truly active platform.
  • Automatic & Dynamic: Requires no manual work and appears on every exam page.
  • Privacy-First: Anonymously counts participation without tracking personal data.
  • Fast & SEO-Friendly: Has virtually zero impact on page speed.

The Build: A Technical Deep Dive

For the developers and the technically curious, here’s how we brought this to life.

The Tech Stack

  • Backend: Google Firebase (Firestore Database)
  • Security: Firebase App Check with Google reCAPTCHA v3
  • Frontend: Vanilla JavaScript (ESM), dynamically injected

The Challenges We Faced

  1. Race Condition: Our initial script failed because the Blogger theme loads content dynamically. This created a race condition where the script would execute before the target content area it needed to attach to even existed on the page.
  2. Content Security Policy (CSP): Our site's strict CSP, designed to keep users safe, was blocking the necessary connections our script needed to make to Firebase.

How We Solved It

  1. The "Watcher" Script: We created a lightweight JavaScript "watcher" that uses a waitForElement function. This tiny observer patiently waits for the h1.post-title element to appear on the page. Only when it confirms the page is ready does it proceed to inject the counter script, completely solving the timing issue.
  2. Atomic & Accurate Counts: To ensure every single visitor is counted securely and accurately, we use Firestore's runTransaction function. This is a secure operation that reads the current count and writes the new count (current + 1) in a single, unbreakable step.
  3. Real-Time Display: To make the counter "live," we use Firestore's onSnapshot listener. This opens a low-overhead, real-time connection to the database, so when the count updates, it's pushed to every active user's browser instantly without a page refresh.
  4. Performance & Privacy by Design: The entire visual component—the styled box, SVG icons, timer, and the GDPR/CCPA-friendly privacy note—is created and styled with JavaScript. This means zero impact on the initial HTML load, ensuring a fast and responsive experience.

Why This Is Different: Proof of Application, Not Just Completion

We see our exams not as a replacement for platforms like Coursera, but as an essential, practical complement.

Platform Focuses On SEOSiri's Approach
Coursera, Udemy, etc. Curriculum Completion & Certificates Verified Skill Application & Live Participation
Traditional Platforms Individual Learning Path Community & Social Proof (You see the global numbers)
Others Often Paid or Freemium Completely Free, Always (Supported by our mission & future sponsors)

When you pass a Google Ads course, you get a certifite badge. When you take the SEOSiri Google Ads Exam, you join a visible, growing list of thousands of professionals who have proven they can apply that knowledge under pressure.

An Invitation to Make Your Mark

Whether you're a marketing professional in Dhaka, a freelance writer in California, an SEO expert in London, or a student just starting out in Lagos—this platform is for you.

This new feature is more than just code; it's a testament to every single person who has invested their time to master their craft. It's a tool that will not only motivate you but will also show future sponsors the incredible, active community we're building together, ensuring these resources remain free forever.

Come and make your mark. Be counted among the best.

Frequently Asked Questions

Is the participation tracking really anonymous? Yes, 100% anonymous. The system respects your privacy by only tracking the page URL to increment a counter. No personal data, IP addresses, cookies, or user information is ever collected or stored.

Are the exams and this live counter feature completely free? Yes, everything is completely free. The platform is supported by our core mission and future sponsorships.

How does this live counter work technically? When an exam page loads, a secure script tells our Firebase Firestore database to increment the count for that page's URL. We use a real-time 'snapshot listener' to display the new total to all active viewers instantly.

How is this different from a traditional online course certificate? A certificate proves completion. Our live counter proves credibility and community momentum. It provides a layer of real-world social proof by showing you are testing your skills on an active platform trusted by a global audience.

Source:
https://www.seosiri.com/2025/11/advanced-exam-system-launch.html

Warmly,
Momenul Ahmad
Founder, SEOSiri.com

on November 16, 2025