Case study
Building Scalable Ecommerce Funnels with the Campaign Cart SDK
Moving from custom API-driven checkouts to a scalable SDK and template system—reducing complexity, improving reliability, and accelerating campaign development.
Standardising high-converting ecommerce funnels through the Campaign Cart SDK, Campaign Page Kit, and shared starter templates.
Early campaign development at NextCommerce relied heavily on the Campaigns API—a CORS-enabled checkout API that handles products, pricing, payments, and order creation without a merchant backend—to build custom, high-performance funnel experiences.
While this approach provided full flexibility, it also led to a pattern of bespoke, one-off implementations—each campaign built independently, with duplicated logic and increasing maintenance overhead.
Over time, this created inconsistency across funnels and introduced risk, as small implementation differences could lead to bugs, tracking issues, or degraded user experience.
From API Flexibility to System Constraints
Using the Campaigns API, we were able to build fast, lightweight external checkouts tailored to specific campaigns.
However, the lack of shared structure meant:
- Repeated implementation of the same cart and pricing logic
- Inconsistent handling of bundles, variants, and upsells
- Increased likelihood of edge cases and regressions
- Slower onboarding for new developers and agencies
Flexibility enabled speed early on—but without constraints, it introduced long-term complexity.
Introducing the Campaign Cart SDK
To address this, I was closely involved in adopting and shaping the Campaign Cart SDK—a frontend abstraction layer that standardises how UI interacts with cart and checkout logic.
Instead of each implementation managing its own state and API interactions, the SDK provides a consistent interaction model across all campaigns.
- Centralised handling of cart state and updates
- Standardised event system for user interactions and analytics
- Declarative UI patterns using data attributes
- Predictable integration with packages, offers, and campaign configuration
Campaign Page Kit & Starter Templates
Alongside the SDK, I worked on a structured template system built on the Campaign Page Kit and a shared library of starter templates—so new funnels are scaffolded, configured, and deployed as static sites rather than built from scratch each time.
Each campaign follows a consistent funnel model—from pre-checkout content through checkout, post-purchase offers, and confirmation—with reusable patterns teams can adapt instead of one-off pages:
- Checkout layouts for different product and variant complexity
- Reusable upsell and bundle-selection patterns
- Matching pre-checkout and landing sections tied to the same campaign setup
- Built-in conventions for layout, performance, and analytics
This gives teams a consistent starting point, integrates directly with the SDK, and keeps focus on content and UX rather than infrastructure.
Single Source of Truth
A major goal of this system was to minimise error propagation by establishing a single source of truth for how campaigns are built.
Instead of logic being duplicated across projects:
- Core functionality lives within the SDK
- Templates define structure and best practices
- Developers extend within a controlled framework
This dramatically reduced inconsistencies and made it easier to maintain and evolve the system over time.
AI-Assisted Template Structuring
To further improve developer experience, we aligned templates with the platform’s AI context workflow—campaign-init --ai-context can install project guidance (CLAUDE.md, AGENTS.md, .cursor/rules/) from the official template context doc so assistants understand Page Kit structure, SDK attributes, and conventions from day one.
We also structured campaigns for human and AI readability:
- Clear, predictable file structures and naming conventions per slug
- Self-documenting components and layout patterns
- Context-friendly markup that can be interpreted and extended safely
The goal was to enable both internal teams and agencies to move faster—with less need for deep platform knowledge.
Design → Code Integration
I also worked closely with designers to bridge the gap between design and implementation.
This included collaboration on an internal tool that extracts coded section templates from design outputs—helping translate Figma layouts into reusable frontend components.
This reduced friction between design and development, and ensured that UI patterns remain consistent across campaigns.
System Thinking: From Fragmentation to Structure
| Before | After |
|---|---|
| Custom API integrations per campaign | Shared SDK interaction model |
| Duplicated logic across projects | Centralised functionality |
| Inconsistent UX and behaviour | Predictable, reusable patterns |
Outcome
The transition to an SDK, Page Kit, and template-driven system significantly improved how campaigns are built and maintained.
It enabled faster development, reduced errors, and created a more consistent experience across funnels—including more reliable analytics and tracking—while still allowing enough flexibility for campaign-specific needs.
This work helped shift campaign development from fragmented implementations to a scalable, system-driven approach that continues to support high-performing ecommerce funnels.