
RevEngine
Marketing, Referral Tracking2023
Referral Tracking and Program Management
DesignKey built RevEngine, a referral tracking platform with multi-level programs, automated payouts, and a tracking snippet for third-party sites.

/summary
RevEngine is a marketing platform designed to streamline and enhance referral tracking for various websites. The client approached us with a ready-made design and a clear vision for developing a system that would accurately track referral registrations and manage referral programs. The challenge was to create a robust platform capable of integrating seamlessly with third-party websites, collecting detailed user registration data, and facilitating payout management based on referral performance.



/context
The client approached us with a ready-made design and a clear vision for the project. The task was to develop a platform that would enable the tracking of referral registrations for various websites. This included implementing a tracking snippet on the client’s sites, which would transmit registration data to the RevEngine system.
Objectives
Tracking Snippet Development
Create a tracking snippet that could be easily embedded into third-party websites to collect and transmit user registration data to the RevEngine system.
Comprehensive Referral Program Management
Develop a system that allows users to register, participate in referral programs, generate personalized referral links, and monitor the performance of these links.
Multi-Level Referral System
Implement a multi-level referral feature that enables users to invite others and earn a percentage of their referrals' activities.
Payout Management
Facilitate efficient tracking and distribution of payments based on users’ referral performance.



/process
1. Planning & Requirement Gathering
Client Collaboration
We started by collaborating closely with the client to fully understand their vision and requirements. This involved detailed discussions and reviews of the provided design.
Technical Analysis
Our team conducted a thorough analysis of the required functionalities, focusing on the integration of the tracking snippet and the multi-level referral system.
2. Development
Tracking Snippet Integration
We developed a lightweight tracking snippet intended for embedding in third-party websites. The snippet is loaded asynchronously so it never blocks the host page's render pipeline. On load, it reads the referral token from the URL query string, writes it to a first-party cookie scoped to the host domain, and listens for a registration completion event. When the event fires, it sends a POST to the RevEngine collection endpoint via the Fetch API with a no-cors mode flag, keeping the request compatible with strict CSP headers on the host site. The payload includes the referral token, the host domain, the registration timestamp, and the user's email hash - no plaintext PII leaves the snippet without explicit host-side consent configuration. The final minified snippet weighed in under 4 KB, well within the threshold that would trigger performance objections from site owners.
Multi-Level Referral System
The commission hierarchy was modeled in PostgreSQL as a self-referencing adjacency structure: each user record carries a referred_by foreign key pointing to the user who invited them. Commission calculations walk the tree upward from the converting user, applying the percentage configured for each program level. To prevent infinite loops from data corruption (a user whose referral chain accidentally points back to themselves), the commission calculation function includes a maximum depth guard and a cycle-detection pass that checks the full ancestor chain before writing any commission record. Programs support up to three levels - primary, secondary, and tertiary - with independent commission rates per level, all configurable by the admin without a code change.
Payout Management
We designed and integrated a system to manage payouts, ensuring that users received payments based on their referral activities. This feature was crucial in maintaining user engagement and trust in the platform.
3. Testing & Refinement
Snippet Compatibility Testing
The tracking snippet required a dedicated QA matrix that went beyond standard browser testing. Our QA specialist tested the snippet across sites built on WordPress, Webflow, Squarespace, and raw HTML/CSS stacks, covering both the happy path (snippet loads, referral token present, registration fires correctly) and the failure modes (snippet loads but token missing, registration event fires before snippet is ready, CSP blocks the outbound POST). For each failure mode, the snippet degrades gracefully rather than throwing an uncaught exception that would surface in the host site's console.
Refinement
Based on testing feedback and client reviews, we continuously refined the platform to enhance its reliability and performance.
4. Deployment & Support
On-Time Delivery
The platform was successfully launched within the agreed timeline, fully functional and aligned with the client’s vision.
Ongoing Support
We provided post-launch support to address any issues and ensure the platform’s smooth operation.


/key features & innovations
Tracking Snippet - Seamless Embedding
The tracking snippet was designed to be easily embedded into third-party websites, allowing for effortless data collection and transmission. The snippet loads asynchronously and self-initializes without requiring a function call from the host site, making the installation instructions a single copy-paste step.
Comprehensive Data Capture
Each registration event captured by the snippet records the referral token, the referring user’s ID, the host domain where the registration occurred, the URL of the registration page, a timestamp, and a hashed identifier for the registering user. This structured payload feeds directly into the RevEngine reporting dashboard, giving program managers a full attribution trail for every conversion.
Referral Link Generation
Each user receives a unique referral link per program they join. Links are generated with a stable token tied to the user’s account ID and the program ID, encoded as a short alphanumeric string that appends cleanly to any destination URL as a query parameter. Click events on referral links are logged server-side - capturing the timestamp, the referring user, and the destination - so the platform can report click-to-registration conversion rates per partner without relying on the snippet alone.
Multi-Level Referral System
Users can invite others and earn commissions based on their referrals’ activities, enhancing user engagement and platform growth. Commission rates are set per program per level by the admin, and the calculation is re-run at payout time against the confirmed conversion record to ensure the rate applied matches the rate in effect when the conversion occurred.
Payout Management - Commission Accrual and Admin Review
Commission accrual is calculated on a rolling basis as conversions are confirmed. Each commission record carries a status - pending, approved, paid, or disputed - and is visible in the admin panel with a full audit trail showing when it was created, when it was reviewed, and by whom. Admins review pending payouts in a queue view that groups them by referral partner, showing the total owed, the breakdown by conversion, and the program rules that produced each amount. Once approved, the payout is marked for processing and the referral partner’s dashboard reflects the updated balance. The audit trail is append-only, meaning no record can be silently edited - disputes are tracked as separate records linked to the original commission entry.

/result & impact
Successful Launch
The platform was delivered on time, fully functional and meeting all of the client’s requirements. The tracking snippet was validated across all target site stacks before launch, and the first live referral conversions were confirmed within the first week of operation.
Partner Self-Service
Before RevEngine, referral partners had to email the client’s team to get reports on their clicks, conversions, and commission balances. After launch, every partner had a self-serve dashboard showing their referral link performance, conversion history, and pending payout status in real time. The volume of inbound reporting requests to the client’s support team dropped to near zero after the first billing cycle.
Attribution Accuracy
The combination of server-side token validation and cookie-based session bridging produced referral attribution that held up across the multi-step registration flows on the client’s partner sites, including flows where users returned to complete registration 24 to 48 hours after the initial click.
Scalability
The platform’s PostgreSQL-backed architecture and Azure hosting allow the client to onboard additional partner sites and referral programs without changes to the core codebase. New programs are configured through the admin UI, and the tracking snippet is the same file regardless of which program a site is participating in - the program association is determined server-side from the referral token at collection time.

/future projections and strategic growth
Strategic Roadmap
As RevEngine continues to grow, plans are in place to integrate more advanced analytics features, providing deeper insights into referral performance.
The platform will expand to support additional marketing tools, making it a comprehensive solution for businesses looking to optimize their referral programs.
Scalability Plan
The platform is designed to scale efficiently, supporting increasing numbers of users and referral programs without compromising performance.

/conclusion
The RevEngine engagement required DesignKey to solve three distinct technical problems simultaneously: building a cross-origin tracking mechanism that would be lightweight enough for third-party adoption, designing a commission model that was both accurate and auditable, and delivering a payout management workflow that gave admins enough visibility to trust the numbers they were approving.
Go deeper
Other Cases


Building a Platform for the Acting Community

Crafting a Personal Brand in the Digital Space
Your next project?
Whether it's an internal tool for your company or a highly available Software-as-a-Service - we help you to get your ideas off the ground!
Start a Similar Project