Analytics
Product analytics, event tracking, funnels, and attribution for Royal Glow.
Analytics
In one line: PostHog is the primary product-analytics platform (funnels,
flags, replay) and Microsoft Clarity adds heatmaps. Meta Pixel + CAPI handle ad
attribution, UTM params drive acquisition_source, and every script loads
only after explicit cookie consent — all on free, DPDP-compliant tiers.
Royal Glow uses PostHog as the primary product analytics platform and Microsoft Clarity for heatmaps and session recordings. Both are free and DPDP Act compliant.
All analytics scripts load only after explicit cookie consent from the user. The cookie consent banner is a custom two-tier implementation — no paid consent management tool needed.
Analytics platforms
Free tier: 1 million events/month — won't hit this limit for a very long time at salon scale.
PostHog covers the full funnel: page views → service browsing → booking → conversion. It also provides:
- Session replay — watch exactly what a user did before dropping off
- Feature flags — A/B test offers without deploying new code
- Funnels — identify drop-off in the booking flow
- Cohort analysis — customers by acquisition source (Meta / GMB / organic / walk-in)
Free tier: Completely free, no event caps, no session limits.
Clarity complements PostHog — it's better at visual heatmaps, PostHog is better at funnel analytics.
What Clarity reveals:
- Are users clicking the booking CTA or ignoring it?
- How far do users scroll on the services page?
- Where do users get confused on the booking form?
- Rage clicks (frustrated rapid clicking) and dead clicks (clicking non-interactive elements)
- Session recordings of real user journeys
Event Taxonomy
| Event | Trigger | Key Properties |
|---|---|---|
page_view | Every page navigation | path, referrer |
service_viewed | Customer opens a service detail | serviceId, serviceName, category, type |
booking_started | Customer opens the homepage booking dialog | source (gmb/walkin/organic) |
booking_step_completed | Each step of booking flow | step (1–4) |
booking_request_submitted | Customer submits booking | serviceType, totalPaise, serviceCount |
booking_confirmed | Receptionist/manager approves | bookingId, staffId |
booking_completed | Service completed, invoice generated | bookingId, totalPaise, paymentMethod |
booking_abandoned | Left booking mid-flow | step, reason |
lead_form_submitted | Meta/Instagram landing form submitted | source, serviceInterested |
lead_converted_to_booking | Captured lead links to a booking | leadId, bookingId, daysSinceCapture |
offer_clicked | Any promotional banner click | offerId, offerName, discountType |
membership_purchased | New SPA membership created | tier, pricePaise, hoursMinutes |
gems_redeemed | Customer redeems gems at checkout | gemsUsed, serviceId |
Funnels
Feature Flags
PostHog feature flags are used to:
- A/B test homepage hero copy
- Gradually roll out new features (e.g., favourite services)
- Enable/disable offers for specific customer cohorts
- Test new booking flow steps without full deployment
// Usage in Next.js
import { useFeatureFlagEnabled } from 'posthog-js/react'
const showNewHero = useFeatureFlagEnabled('new-hero-v2')Meta Attribution
Fires on key events:
PageView— every pageViewContent— service detail pagesLead—/bookform submissionCompleteRegistration— onboarding completionPurchase— booking completion with invoice
Server-side events sent from Next.js API routes. These are reliable and unaffected by iOS privacy restrictions or ad blockers.
Key CAPI events:
Lead— fired fromPOST /api/leadswhen a Meta ad lead is capturedCompleteRegistration— fired fromPOST /api/onboarding/completePurchase— fired fromPOST admin.theroyalglow.in/api/bookings/[id]/complete
CAPI events include hashed customer data (email, phone) for better match rates.
UTM Attribution
All booking entry points carry UTM parameters that are persisted through the OAuth redirect via sessionStorage:
| Source | Entry URL | acquisition_source |
|---|---|---|
| Google Maps / GMB | /?book=1&utm_source=gmb | gmb |
| In-store QR code | /?book=1&utm_source=walkin | walkin |
| Meta/Instagram ad | /book?utm_source=meta&utm_campaign=... | meta_ad |
| Organic (root domain) | / | organic |
The acquisition_source is stored on the customer_profile row at onboarding and on every booking row — enabling lifetime value analysis by acquisition channel.
Consent Management
Analytics scripts are gated behind the cookie consent banner:
| Script | Consent Required | Default |
|---|---|---|
| PostHog | Analytics consent | Off |
| Microsoft Clarity | Analytics consent | Off |
| Meta Pixel | Marketing consent | Off |
| Meta CAPI | Marketing consent | Off |
Consent preference is stored in localStorage (rgss_cookie_consent) for 365 days.
Monitoring AI Search Performance
Track whether Royal Glow appears in Google AI Overviews:
Google Search Console
"AI Overview" impressions appear in the Performance report.
Manual search audits
Weekly: search target queries in incognito, check AI answer inclusion.
PostHog referrer tracking
Track visits where referrer contains google.com.
Queries to monitor weekly:
- "best salon in Bengaluru"
- "luxury spa near me" (from your city)
- "[service name] price in Bengaluru"
- "Royal Glow Salon"
Was this page helpful?