Custom Website GA4 E-Commerce & Full-Funnel Lead Tracking with Microsoft Clarity
Executive Coaching & Digital Products Platform Case Study
Custom Laravel & Inertia.js SPA tracking with GA4 full-funnel e-commerce, multi-currency normalization, Microsoft Clarity heatmaps, and duplicate purchase prevention.
Open original case study PDF ↗The business and the challenge
Kijir (kijir.com) is an executive career coaching and personal branding platform founded by Md Ziaul Kader, a 5.0-rated LinkedIn & Global Job Search Strategist based in Doha, Qatar. The platform serves professionals worldwide through three distinct commercial channels: high-ticket 1:1 consulting and executive mentorships ($100 to $4,999 USD), digital self-study products ($9.99 e-books and resume templates), and structured online courses ($49 self-paced course and $249 live cohorts), alongside inbound lead channels for Calendly discovery calls, WhatsApp inquiries, and email consultations.
Unlike traditional WordPress or Shopify stores that rely on pre-built e-commerce plugins, Kijir was built from scratch as a modern Single Page Application (SPA) using Laravel, Inertia.js, and Vue 3. This custom architecture created critical measurement hurdles:
- Zero Native E-Commerce Tracking: No data layer existed on the site. Checkout modals, service tiers, and package wizards rendered dynamically via Vue components without standard page reloads, leaving Google Analytics 4 completely blind to product views, email captures, and checkout progression.
- GeoIP Dynamic Currency Skew: The site converted displayed prices on-the-fly based on visitor IP (e.g. showing S$6,438 SGD to Singapore visitors for a $4,999 USD mentorship program). Tracking raw screen figures directly into GA4 risked corrupting revenue reporting with mismatched currency units.
- Cross-Domain Payment Gateway Drop-offs: Checkout transactions routed through external gateways (Tap Payments in USD and SSLCommerz in BDT). Without client-side persistence, return confirmation URLs lacked order attribution, and customer page refreshes risked triggering duplicate purchase conversions.
- No Behavioral Heatmaps: High-ticket executive funnels had zero session recording or heatmap visibility to analyze where prospective consulting clients hesitated or dropped off.
My strategy
I engineered a non-invasive, production-grade tracking architecture deployed entirely through Google Tag Manager, requiring zero code modifications to the client's Laravel backend:
- Canonical Data Layer Contract: Implemented the universal
{ ecommerce: null }reset pattern prior to every event push, preventing parameter pollution across rapid single-page interactions. - Client-Side Event Emitter Engine (Tag 31): Developed a custom JavaScript emitter pairing capture-phase DOM delegation with a fine-grained
MutationObserverto capture modal mounts, package selections, email entries, and checkout submissions. - Client-Side Purchase Persistence Engine (Tag 32): Pre-stored pending checkout transaction payloads in browser
localStorage(kijir_pending_tx) atbegin_checkout. When the payment gateway redirected back to the order return URL, Tag 32 matched the transaction ID, emitted a clean numericpurchaseevent, and immediately wrote a persistent idempotency lock (_ga4_tracked_tx_{id}) to permanently block duplicate fires upon page refresh. - Universal USD Currency Normalization: Locked 100% of e-commerce events to base USD by combining an authoritative internal catalog table with automatic reverse exchange calculation (
price / rate) for any unmapped tiers. - Behavioral Analytics Integration: Deployed Microsoft Clarity via GTM, binding GA4 Client ID and Session ID into Clarity custom dimensions for 1:1 correlation between GA4 analytics funnels and visual session recordings.
Connect the website and verify tags
I connected the Google Tag Manager container (GTM-PR22WRXT) to the live Kijir storefront and confirmed active synchronization through Google Tag Assistant.

I then performed an independent live browser verification using third-party tag inspection extensions. Google Tag Manager, Google Analytics 4 (G-4WSTY4XK77), and Microsoft Clarity (zauhb5v3y9) were all detected active on the live site.

Technical challenges and complex SPA hurdles overcome
Operating inside a custom Laravel and Inertia.js single page application presented seven intricate tracking challenges that standard setups cannot handle:
- 1. Single-Page Dynamic DOM Hydration: Modals and checkout screens mount dynamically without page reloads. I deployed a fine-grained
MutationObserverpaired with capture-phase click interception that reads modal mount states, queries Inertia.js page props (data-page), and extracts product titles and IDs with zero backend dependencies. - 2. View Item Over-Counting Elimination: In early testing, user keystrokes in email fields caused Vue modal components to re-render, firing
view_item3 to 4 times per session. I implemented stateful DOM dataset tagging (dataset.ga4ViewTracked) and debounce thresholds, ensuringview_itemfires strictly once per package while seamlessly allowing legitimate package switches. - 3. GeoIP Multi-Currency Normalization: The website dynamically converted prices based on visitor IP (e.g. S$6,438 SGD vs. $4,999 USD). I built a dual resolver featuring an authoritative database catalog table ($4,999 for 12-Month, $2,999 for 1-Year Mentorship, $49 for Course, $9.99 for Digital Products) plus dynamic reverse-exchange calculation (
price / rate), locking 100% of GA4 values to pure USD. - 4. Crossed-Out "Old Price" Sanitization: Several service cards displayed crossed-out original prices (e.g., S$7,727 crossed out, S$6,438 current). Naive regex extractors pulled the crossed-out figure. I built an in-memory DOM clone sanitization routine that strips
<del>,<s>,<strike>, andclass*="old"elements prior to extracting numeric values. - 5. Multi-Step Strategy Wizard Package Switching: In the interactive "Want to learn my strategy?" funnel, Step 1 selects career challenges and Step 2 presents package options via radio cards. I added active option listeners for
.option-choice, updating the in-memory offer state and pushing dedicatedview_itemevents so subsequent checkout steps carry exact package details. - 6. Universal Checkout Button Detection: Different products used different button labels ("Buy Now" for e-books, "Enroll Now" for courses, "Book Now" for services, "Book & Pay Now" for strategy paths). I unified detection using an inclusive case-insensitive regex (
/Buy Now|Book Now|Enroll Now|Pay|Proceed|Checkout|Confirm|Book & Pay/i) coupled with active checkout email verification. - 7. Payment Gateway Return & Reload Idempotency: External redirects to Tap Payments and SSLCommerz risk duplicate purchases if the user refreshes the return page. Tag 31 snapshots pending transactions in
localStorage, while Tag 32 validates transaction IDs upon return, emits the conversion hit, and writes an idempotency lock to block repeat executions.
Configure GA4 settings and Microsoft Clarity
In Google Analytics 4 admin, I verified that data collection acknowledgements were completed and active collection was acknowledged.

In the Microsoft Clarity console, I verified active session ingestion, heatmap recording, and scroll depth monitoring.

Finally, I upgraded the GA4 Event Data Retention setting from the default 2 months to the maximum 14 months, ensuring long-term cohort analysis for high-ticket consulting cycles.

Test tag firing and full-funnel validation
I tested all customer journeys in Tag Assistant preview mode across digital products, courses, 1:1 services, and the multi-step strategy wizard. All 12 tags fired in expected sequence without runtime errors.

In Google Analytics 4 Realtime and DebugView, all core funnel events—page_view, view_item, generate_lead, begin_checkout, purchase, schedule_call, and contact clicks—were verified arriving with pure numeric values (epn.value), correct USD currency, and rich items array parameters.

Results
The deployed tracking architecture delivered complete commercial measurement across Kijir's executive coaching platform:
- Complete Commercial Coverage: Flawless full-funnel visibility across $9.99 digital products, $49 courses, and high-ticket $4,999 executive mentorship programs.
- Zero Backend Modifications: Entire tracking engine deployed client-side via Google Tag Manager without consuming client engineering resources.
- Audit-Ready Data Integrity: Clean numeric float parameters (
epn.value) and zero duplicate purchases ensure trustworthy metrics for Google Ads Smart Bidding, ROAS optimization, and financial reporting. - Actionable UX Insights: Microsoft Clarity heatmaps and session recordings linked 1:1 with GA4 sessions provide deep behavioral clarity into high-ticket funnel drop-offs.
A free tracking audit
Share your website and tracking requirements for a free review of your tags and potential issues.
Claim your free tracking audit


