← All work
Shipped · live on client site

Marketing ROI Simulator

A standalone, zero-dependency marketing budget simulator for a boutique European marketing agency. It captures visitor intent through a GDPR-compliant lead gate and models Meta & Google advertising performance by combining industry benchmarks with real campaign historical data. Every submission is piped to an n8n automation engine that updates a Google Sheets cockpit and instantly fires email alerts to the sales team.

Vanilla JSn8nGA4 APIGoogle SheetsWix Embed
roi-simulator.demo
Marketing ROI Simulator screenshot

The challenge

Scattered benchmarks and a leak-heavy lead funnel.

The agency wanted an interactive lead magnet on their Wix-hosted site where prospective clients could model advertising returns in their specific sector (Hospitality, Construction, B2B, etc.). The challenge was three-fold: the widget had to be lightweight and single-file to bypass Wix's strict iframe limits, it had to model multi-stage marketing funnels (Meta Ads and Google Search clicks) using actual historical data from 50+ managed client campaigns, and it needed to capture and route lead events instantly to the sales team without risking data loss or exposing backend operational logic.

The solution

Lightweight Vanilla UI and a Token-Isolated n8n Webhook.

I built the widget as a self-contained, single-file HTML/CSS/JS application with zero dependencies to ensure 100+ Lighthouse scores and instant loading within Wix Classic embeds. Instead of direct API access on Wix or exposing sensitive tokens, the widget communicates with a self-hosted n8n webhook. When a user submits the GDPR-compliant lead form, n8n writes the data to a Google Sheets database, handles duplicate events via UUIDs, and triggers an email notification to the sales team only when the user requests a follow-up. An 'internal mode' (via URL parameters) allows agency representatives to skip the gate for live pitches.

The User Journey

From simulation to warm lead.

01

Goal & Sector selection

Visitor selects one of 4 marketing goals (Awareness, Traffic, Leads, Recruitment) and one of 15 sectors.

02

Budget & Mix

Visitor sets a monthly budget and drags a single slider to adjust the Meta / Google Ads split.

03

Lead gate submission

Visitor fills in contact details. n8n stores the lead in Google Sheets and tags the event as lead_aangemaakt.

04

Performance projection

Widget renders expected reach, clicks, CPL, and monthly leads growth on a dynamic chart.

05

Sales notification

Visitor can request a follow-up meeting. If clicked, n8n flags the lead in Google Sheets and instantly alerts the sales team by email.

What it does

The moving parts.

Technical stack

How it's built.

Vanilla JS / CSS
Used for maximum flexibility, instant page speed (Lighthouse performance >95), and zero build-step overhead within the Wix iframe.
n8n
The integration engine, hosting the webhook endpoint that receives lead data and orchestrates database updates and sales notifications.
Google Sheets
Serves as the lead storage ledger, giving the sales team a transparent, read-only dashboard of all prospects.
Google Analytics (GA4)
Pushes dataLayer events (simulator_gestart, lead_verzonden, meeting_gevraagd) to a Google Tag Manager container inside the iframe for accurate campaign tracking.

How it fits together

How the pieces connect.

Lightweight frontend widget connected to n8n for database storage and instant notifications. Here is the data flow.

Wix Website EmbedWix Iframe
Marketing ROI SimulatorVanilla JS / CSS
n8n WebhookIntegration Spine
Google SheetsLead Database
Sales Mailbox (Gmail)Agent Notification

Who this fits for

Who it's for.

Marketing agenciesAgencies looking for a high-converting, interactive lead magnet to capture warm prospects.
Low-overhead dev projectsWeb widgets that must load instantly inside restrictive CMS environments like Wix, Squarespace, or Webflow.
Data-driven sales teamsTeams who want to demo campaign projections on the fly using real historical data.

Screens

A look inside.

Questions & comments

Curious about this build?

Interested, or want to ask how something works? Leave a public comment.

Loading comments…

Comments are public. Links are shown as plain text, not clickable.