Website forms
Wire the enquiry form on your own website straight into Atlas — a small fetch() on submit is all it takes. Works with any static site, landing page or custom stack.
Your webhook URL (with its secret token) lives in Atlas → Settings → Integrations → Lead Webhook — open it there and use the copy button. Docs pages always show
{token} as a placeholder; your real URL never appears on this public site.Option A — straight from the browser#
Simplest possible setup: the form posts directly to your webhook from the visitor's browser. Fine for most agency sites — the token in your page source can only create leads, nothing else.
HTML
<form id="enquiry-form"> <input name="name" placeholder="Your name" required /> <input name="phone" placeholder="Phone / WhatsApp" required /> <input name="email" placeholder="Email (optional)" /> <input name="destination" placeholder="Where do you want to go?" /> <textarea name="message" placeholder="Tell us about your trip"></textarea> <button type="submit">Send enquiry</button> </form>
JavaScript
const WEBHOOK = 'https://adwixatlas.com/api/webhooks/leads/{token}'
document.getElementById('enquiry-form').addEventListener('submit', async (e) => {
e.preventDefault()
const data = Object.fromEntries(new FormData(e.target))
data.source = 'website'
// Optional: forward Meta ad attribution (see the Ad attribution guide)
const fbclid = new URLSearchParams(location.search).get('fbclid')
if (fbclid) data.fbclid = fbclid
data.source_url = location.href
const res = await fetch(WEBHOOK, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data),
})
if (res.ok) {
e.target.reset()
alert('Thank you! We\'ll get back to you shortly.')
} else {
alert('Something went wrong — please try again or call us.')
}
})Option B — from your server#
If your site already has a backend handling the form (Next.js action, PHP handler, Express route), forward the lead from there instead — the token stays out of page source entirely, and you can validate or enrich before sending.
Server-side
// Node / Next.js / any backend — after validating your own form:
await fetch('https://adwixatlas.com/api/webhooks/leads/{token}', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
name: form.name,
phone: form.phone,
email: form.email,
destination: form.destination,
message: form.message,
source: 'website',
}),
})Always send source: "website"(or a Settings → Lead Sources value of yours like "google ads") — leads without a source default to “meta”, which will mislabel your website enquiries in analytics.
