Royal Glow internal docs · now fully interactive — Steps, API tables, file trees & live status
Royal Glow Docs

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

EventTriggerKey Properties
page_viewEvery page navigationpath, referrer
service_viewedCustomer opens a service detailserviceId, serviceName, category, type
booking_startedCustomer opens the homepage booking dialogsource (gmb/walkin/organic)
booking_step_completedEach step of booking flowstep (1–4)
booking_request_submittedCustomer submits bookingserviceType, totalPaise, serviceCount
booking_confirmedReceptionist/manager approvesbookingId, staffId
booking_completedService completed, invoice generatedbookingId, totalPaise, paymentMethod
booking_abandonedLeft booking mid-flowstep, reason
lead_form_submittedMeta/Instagram landing form submittedsource, serviceInterested
lead_converted_to_bookingCaptured lead links to a bookingleadId, bookingId, daysSinceCapture
offer_clickedAny promotional banner clickofferId, offerName, discountType
membership_purchasedNew SPA membership createdtier, pricePaise, hoursMinutes
gems_redeemedCustomer redeems gems at checkoutgemsUsed, 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 page
  • ViewContent — service detail pages
  • Lead/book form submission
  • CompleteRegistration — onboarding completion
  • Purchase — 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 from POST /api/leads when a Meta ad lead is captured
  • CompleteRegistration — fired from POST /api/onboarding/complete
  • Purchase — fired from POST 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:

SourceEntry URLacquisition_source
Google Maps / GMB/?book=1&utm_source=gmbgmb
In-store QR code/?book=1&utm_source=walkinwalkin
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.

Analytics scripts are gated behind the cookie consent banner:

ScriptConsent RequiredDefault
PostHogAnalytics consentOff
Microsoft ClarityAnalytics consentOff
Meta PixelMarketing consentOff
Meta CAPIMarketing consentOff

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"
OpenReport an issue

Was this page helpful?

On this page