Skip to main content

Embedding guide

Add the Onramp Kit configurator to your website with a simple code snippet. This guide covers the standard embed, configuration options, and advanced patterns.

Basic embed

The simplest integration requires just two elements: a container and a script.

<!-- Container: where the configurator appears -->
<div
data-deep-fathom-onramp
data-partner-id="your-partner-id"
data-handoff-url="https://app.deepfathom.ai/signup"
></div>

<!-- Loader: initializes the configurator -->
<script type="module" src="https://cdn.deepfathom.ai/onramp-kit/v1/widget.mjs"></script>

Place the container <div> wherever you want the configurator to appear on your page. The script can go in the <head> or at the end of <body>—it loads asynchronously and won't block your page.

Required attributes

AttributeDescription
data-deep-fathom-onrampMarks this element as the configurator container
data-partner-idYour unique partner identifier for attribution
AttributeDescription
data-handoff-urlWhere visitors go after completing the assessment (typically the Deep Fathom signup page)
data-hostThe hosted configurator origin (required for cross-origin embeds)

Supporting older browsers

For maximum browser compatibility, include a fallback script for browsers that don't support ES modules:

<div
data-deep-fathom-onramp
data-partner-id="your-partner-id"
data-handoff-url="https://app.deepfathom.ai/signup"
></div>

<!-- Modern browsers use this -->
<script type="module" src="https://cdn.deepfathom.ai/onramp-kit/v1/widget.mjs"></script>

<!-- Older browsers (IE11, legacy Edge) use this instead -->
<script nomodule src="https://cdn.deepfathom.ai/onramp-kit/v1/widget.legacy.js"></script>

Modern browsers ignore the nomodule script; older browsers ignore type="module". This pattern ensures the configurator works everywhere.

Configuration options

Attribution

Track where your leads come from with UTM parameters and referral codes:

<div
data-deep-fathom-onramp
data-partner-id="your-partner-id"
data-handoff-url="https://app.deepfathom.ai/signup"
data-referral-code="SPRING2025"
data-utm-source="partner-website"
data-utm-medium="embed"
data-utm-campaign="cmmc-assessment"
></div>

All attribution data flows through to leads and handoff URLs, so you can track performance in your analytics and CRM.

AttributeDescription
data-referral-codeCustom code for campaigns or sales tracking
data-attribution-sourceOverride the default source identifier
data-utm-sourceUTM source parameter
data-utm-mediumUTM medium parameter
data-utm-campaignUTM campaign parameter
data-utm-contentUTM content parameter
data-utm-termUTM term parameter

Snapshots and sharing

Enable visitors to save and share their assessment progress:

<div
data-deep-fathom-onramp
data-partner-id="your-partner-id"
data-snapshot-endpoint="https://api.deepfathom.ai/snapshots"
data-handoff-url="https://app.deepfathom.ai/signup"
></div>
AttributeDescription
data-snapshot-endpointAPI endpoint for saving assessment state (enables sharing and resume)
data-handoff-urlDestination URL that receives the snapshot ID and attribution
data-allow-url-piiSet to true to include company name in URL snapshots (default: redacted for privacy)

See the Snapshots reference for details on how sharing and resume work.

Rendering mode

The configurator can render in two modes:

<div
data-deep-fathom-onramp
data-partner-id="your-partner-id"
data-mode="iframe"
></div>
ModeDescription
iframeDefault. Renders in an isolated iframe for maximum compatibility and security isolation.
inlineRenders directly in your page DOM. Requires modern browser features. (Coming soon)

For most integrations, leave this unset—the SDK automatically chooses the best mode for the visitor's browser.

Versioning

The SDK follows semantic versioning. Choose a version strategy based on your needs:

URL patternBehavior
.../v1/widget.mjsLatest stable v1.x release (recommended)
.../v1.2.3/widget.mjsPinned to specific version (for reproducible deployments)
.../latest/widget.mjsLatest release including pre-releases (not recommended for production)

Pre-release versions (like v1.3.0-rc.1) don't update the v1 or latest aliases.

Programmatic initialization

For more control, initialize the configurator with JavaScript instead of data attributes:

import { mount } from '@onramp-kit/sdk';

mount('#configurator-container', {
partnerId: 'your-partner-id',
host: 'https://onramp.deepfathom.ai',
handoffUrl: 'https://app.deepfathom.ai/signup',
snapshotEndpoint: 'https://api.deepfathom.ai/snapshots',
mode: 'iframe',
theme: { mode: 'auto' },
attribution: {
referralCode: 'SPRING2025',
utmSource: 'partner-website',
utmMedium: 'embed',
utmCampaign: 'cmmc-assessment',
},
allowUrlPii: false,
});

This approach is useful when you need to:

  • Set configuration dynamically based on user context
  • Initialize multiple configurators on one page
  • Integrate with a JavaScript framework (React, Vue, etc.)

Security considerations

Content Security Policy (CSP)

If your site uses a Content Security Policy, add these directives:

script-src: https://cdn.deepfathom.ai
frame-src: https://onramp.deepfathom.ai
connect-src: https://api.deepfathom.ai

Iframe restrictions

If your site sets X-Frame-Options or frame-ancestors policies, ensure they don't block the configurator's iframe. The configurator iframe loads from https://onramp.deepfathom.ai.

If something doesn't load

Common issues and solutions:

SymptomLikely causeSolution
Blank space where configurator should beScript blocked by CSPAdd CDN to script-src directive
"Refused to frame" error in consoleIframe blocked by policyAdd origin to frame-src directive
Configurator loads but events don't fireOrigin mismatchVerify data-host matches iframe origin

See Browser support for detailed compatibility information.

All configuration attributes

AttributeRequiredDescription
data-deep-fathom-onrampYesMarks element as configurator container
data-partner-idYesYour partner identifier
data-hostFor cross-originHosted configurator origin
data-handoff-urlRecommendedDestination after completion
data-snapshot-endpointFor sharingSnapshot API base URL
data-modeNoiframe (default) or inline
data-iframe-srcNoOverride full iframe URL
data-referral-codeNoCampaign/sales tracking code
data-attribution-sourceNoOverride source identifier
data-utm-sourceNoUTM source
data-utm-mediumNoUTM medium
data-utm-campaignNoUTM campaign
data-utm-contentNoUTM content
data-utm-termNoUTM term
data-allow-url-piiNoInclude PII in URL snapshots (true/false)

Next steps