Documentation
Install in minutes. Connect to anything.
One script tag puts a calculator on any website. The pages below cover WordPress, site builders, conversion tracking, signed webhooks, the API and the consent record every lead carries.
Embed on any website
In your dashboard, open Calculators and click Copy embed. Paste the snippet into your page where the calculator should appear. It renders in a responsive iframe that sizes itself to its content.
<script src="https://calcpro-pi.vercel.app/api/embed/widget.js"
data-calculator-id="YOUR-CALCULATOR-ID"
data-title="Mortgage Calculator"></script>Optional attributes:
| Attribute | Default | What it does |
|---|---|---|
data-width | 100% | Width of the calculator within its container. |
data-max-width | 440px | Upper bound, so it stays a card on wide pages. |
data-align | center | left, center or right. |
data-title | Calculator | Accessible name of the iframe for screen readers. |
Several calculators on one page work: paste one snippet per calculator. The loader passes the address of the page it runs on to the calculator, so each lead records the exact page and any utm_source, utm_medium and utm_campaign values in that page’s URL.
Under Allowed websites you can restrict where a calculator may load. Leave it empty while testing; set it before going live so the snippet cannot be copied onto someone else’s site.
Each plan includes a number of websites for the whole account (subdomains count as the same website). A website is added the first time one of your calculators loads there, and the list is under Calculators. On a website beyond your plan, the calculator keeps working for 14 days and then shows a short notice instead. Removing a website from the list frees its place. Previews and share links on CalcMagnet never count.
Popup and floating button
The same script can show a button instead of the calculator. The calculator opens in a window over your page when the button is clicked, and loads only then. In the dashboard, pick Popup button or Floating button above the embed code; without data-mode the calculator stays inline as above.
Popup button — a button where you paste the snippet:
<script src="https://calcpro-pi.vercel.app/api/embed/widget.js"
data-calculator-id="YOUR-CALCULATOR-ID"
data-title="Mortgage Calculator"
data-mode="popup"
data-button-text="Calculate your payment"></script>Floating button — fixed in a corner of every page the snippet is on (paste it once, for example in your site footer):
<script src="https://calcpro-pi.vercel.app/api/embed/widget.js"
data-calculator-id="YOUR-CALCULATOR-ID"
data-title="Mortgage Calculator"
data-mode="floating"
data-position="bottom-right"></script>| Attribute | Default | What it does |
|---|---|---|
data-mode | inline | popup, floating, or manual (no button; open it from your own code, below). |
data-button-text | Calculate your payment | Button label, up to 80 characters, shown as plain text. |
data-button-color | Your brand colour | Button colour as a hex value such as #0EA5E9. Leave it out to use the primary colour from Branding. The text turns black or white to stay readable. |
data-position | bottom-right | Floating button corner: bottom-right or bottom-left. |
data-lang | en | es gives the button and window Spanish defaults (“Calcula tu pago”). |
data-title | Calculator | Heading of the window and accessible name of the calculator. |
The window closes with its close button, the Esc key or a click outside it, and keyboard focus stays inside it while it is open. On phones it fills the screen. A floating button and an inline calculator can share a page. Views are counted when the window is first opened, and leads fire the same conversion events as an inline calculator.
Your own button. Any page with the script on it can open and close the window from JavaScript:
<script src="https://calcpro-pi.vercel.app/api/embed/widget.js"
data-calculator-id="YOUR-CALCULATOR-ID" data-mode="manual"></script>
<button onclick="CalcMagnet.open()">Check my payment</button>
<script>
// CalcMagnet.open() opens the calculator from the snippet
// CalcMagnet.open('ANOTHER-CALCULATOR-ID') opens a specific calculator
// CalcMagnet.close() closes the window
// CalcMagnet.isOpen() true or false
window.addEventListener('calcmagnet:open', function (e) { /* e.detail.calculatorId */ });
window.addEventListener('calcmagnet:close', function (e) { /* e.detail.calculatorId */ });
</script>WordPress plugin
The CalcMagnet Calculators plugin (v1.1.0) adds a shortcode and a block, so you never touch HTML.
- Download the plugin zip (v1.1.0).
- In WordPress go to Plugins → Add New → Upload Plugin, choose the zip and activate it.
- Optionally set a default calculator ID under Settings → CalcMagnet.
- Add the CalcMagnet Calculator block, or use the shortcode:
[calcmagnet id="YOUR-CALCULATOR-ID" width="100%" align="center"]The plugin only embeds the calculator. Lead capture, the branded PDF, consent recording and CRM delivery all run on CalcMagnet, so nothing is stored in your WordPress database and nothing needs updating when we ship improvements.
Wix, Squarespace, Webflow, GoHighLevel and others
Any builder with a “custom code” or “embed HTML” element takes the script snippet above:
- Wix: Add → Embed Code → Embed HTML, paste the snippet, then resize the element to about 440 × 900 px.
- Squarespace: add a Code block (Business plan or higher) and paste the snippet.
- Webflow: add an Embed element and paste the snippet.
- GoHighLevel funnels: add a Custom JS/HTML element and paste the snippet.
If a builder strips <script> tags, use the hosted page in a plain iframe instead. Auto-resize is not available this way, so give the frame a fixed height (about 900 px for mortgage calculators, 800 px for solar):
<iframe src="https://calcpro-pi.vercel.app/widget/YOUR-CALCULATOR-ID?host=https://your-site.com/page"
title="Mortgage Calculator" style="width:100%;max-width:440px;height:900px;border:0"
loading="lazy"></iframe>The host parameter is optional; it tells the calculator which page it sits on so leads are attributed correctly. You can also link to the hosted page directly from an email or a QR code.
Track leads as conversions
When a visitor submits the lead form, the embed tells the page it lives on. Nothing personal is included — just the calculator ID and the lead’s quality tier. It fires, in this order, whatever is present on your page:
- A DOM event
calcmagnet:leadonwindow. - A Google Tag Manager push:
dataLayer.push({ event: 'calcmagnet_lead', calcmagnet_calculator_id, calcmagnet_quality_tier }). - A GA4 event when
gtagexists:gtag('event', 'generate_lead', { calculator_id, quality_tier, source: 'calcmagnet' }). - A Meta Pixel event when
fbqexists:fbq('track', 'Lead').
To run your own code, listen for the event:
window.addEventListener('calcmagnet:lead', function (e) {
// e.detail = { calculatorId: '…', qualityTier: 'hot' | 'warm' | 'cold' | null }
console.log('CalcMagnet lead', e.detail);
});In Google Tag Manager, create a Custom Event trigger named calcmagnet_lead and attach your Google Ads or GA4 conversion tag to it. In GA4, mark generate_lead as a key event.
Webhooks and Zapier
Connect Webhook or Zapier under Integrations and every new lead is POSTed as JSON to your URL within seconds. Failed deliveries (network errors, 429, 5xx) are tried up to three times in total. Every attempt is listed on the Integrations page, and Send test lead delivers a sample so you can check the mapping before real leads arrive.
{
"event": "new_lead", // or "test_lead"
"delivery_id": "a1b2…", // the same across retries of one delivery, for de-duplication
"timestamp": "2026-11-09T14:03:22.000Z",
"lead_id": "6f2c…",
"first_name": "Ana", "last_name": "Lopez",
"email": "ana@example.com", "phone": "+1 555 010 0100",
"quality_score": 85, "quality_tier": "hot",
"source_url": "https://your-site.com/mortgage-calculator?utm_source=google",
"utm_source": "google", "utm_medium": "cpc", "utm_campaign": "spring",
"calculator_type": "purchase", "calculator_name": "Mortgage Calculator",
"calculator_inputs": { "homePrice": 400000, "downPct": 20, "rate": 6.5, "termYears": 30 },
"calculator_results": { "monthlyPayment": 2023, "totalCost": 728280 },
"consent_given": true,
"consent_text": "I agree that Broker Co may contact me by email, phone or text message…"
}Verifying deliveries. Each request carries three headers:
| Header | Value |
|---|---|
X-CalcMagnet-Event | new_lead or test_lead |
X-CalcMagnet-Delivery | The delivery_id from the body |
X-CalcMagnet-Signature | t=<unix seconds>,v1=<hex HMAC-SHA256> |
The signature is an HMAC-SHA256 of <t>.<raw body> using the signing secret shown on the Integrations page. Verify it and reject timestamps older than five minutes:
import { createHmac, timingSafeEqual } from 'node:crypto';
export function verifyCalcMagnet(rawBody, header, secret) {
const { t, v1 } = Object.fromEntries(header.split(',').map(p => p.split('=')));
if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
const expected = createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
return v1.length === expected.length && timingSafeEqual(Buffer.from(v1), Buffer.from(expected));
}Zapier’s “Catch Hook” does not verify signatures; that is fine — the hook URL itself is secret.
API
Pro and Business plans can create an API key under Integrations. The key is shown once; CalcMagnet stores only a hash. Send it as a bearer token. Limit: 60 requests per minute per key.
curl "https://calcpro-pi.vercel.app/api/v1/leads?limit=25&status=new" \
-H "Authorization: Bearer cpk_your_key"
curl -X PATCH "https://calcpro-pi.vercel.app/api/v1/leads/LEAD_ID" \
-H "Authorization: Bearer cpk_your_key" -H "Content-Type: application/json" \
-d '{"status": "contacted", "notes": "Called, sending rates Friday"}'| Endpoint | Returns |
|---|---|
GET /api/v1/leads | Your leads, newest first, as { data: [...], has_more: boolean }. Query options: limit (1–100, default 25), since and before (ISO 8601 dates, exclusive), status (new, contacted, qualified, converted, lost). Page by passing the oldest created_at you have as before. |
GET /api/v1/leads/{id} | One lead, as { data: {...} }. |
POST /api/v1/leads | Adds a lead from another system. Only email is required. Also accepted: first_name, last_name, phone, address, notes, status, calculator_id, source_url, utm_source, utm_medium, utm_campaign, calculator_inputs and calculator_results (flat objects), consent_given with consent_text (the sentence the person agreed to), and notify. The lead is scored and counts toward your monthly leads. With notify: true it is also sent to your connected CRMs and lead routing runs; leave it off when the lead came from your CRM. Returns 201 with the lead. |
PATCH /api/v1/leads/{id} | Changes status, notes, assigned_to (a team member’s user id, or null), first_name, last_name, phone or address. The email, consent record and calculator data cannot be changed: they record what the person submitted. |
GET /api/v1/me | Checks the key and returns your organization’s name and id. |
Everything is scoped to your organization. Errors return a JSON error message: 401 for a bad key, 404 for a lead that is not yours, 422 for a field that is missing or not allowed. To push leads into other systems the moment they arrive, use a webhook; to pull them on a schedule (for example a Zapier “Retrieve Poll” trigger) or to keep status in step with your CRM, use this API.
Consent and compliance
Every lead form requires the visitor to tick a consent box before submitting. The sentence names only your company and is written to serve as prior express written consent for calls and texts, the standard the TCPA sets for marketing calls and texts. Whether it is enough for your situation is a question for your own compliance adviser:
I agree that {Your Company} may contact me by email, phone or text message (including automated calls or texts) about my inquiry. Consent is not a condition of purchase. I can opt out at any time.With each lead CalcMagnet records, on its own servers:
- that the box was ticked, the exact sentence shown (rebuilt server-side, not taken from the browser),
- the time, the visitor’s IP address and browser string,
- the page the calculator was on.
The record appears on each lead in the dashboard, in the CSV export, in webhook payloads and over the API, so your compliance team can prove consent for any contact you make. Spanish-language calculators show and store the Spanish sentence.
Mortgage calculators also display your company name, your NMLS ID when set, the Equal Housing Opportunity mark and an “estimates only” disclaimer that you can replace with your own text under Settings. The PDF report carries the same.
CalcMagnet is a tool you operate; the leads are yours and the obligations of a caller or sender under TCPA, CAN-SPAM and state law remain with you. See the Terms of Service and Privacy Policy.
Your data
- Leads belong to you. CalcMagnet does not sell, share or use them for anything but delivering them to you.
- Export every lead at any time as CSV, or read them over the API.
- Delete leads individually or in bulk from the dashboard; deleting your account removes your organization and its data.
- Hosting: Vercel (application) and Supabase (database and authentication), both in the United States.
- English and Spanish are supported on every calculator, lead form and report.