Search Results

View results or start a new search using the form below.
No matching results.
(function () { var CLEARSITE_SLUG = 'top-down-cpm'; var CLEARSITE_KEY = 'cs_live_a3bc43526370d754b9b70b00c1d16a8d'; var CS_ENDPOINT = 'https://getclearsite.com/api/v1/sites/' + CLEARSITE_SLUG + '/forms/contact'; function getUTM() { var params = new URLSearchParams(window.location.search); var utm = {}; if (params.get('utm_source')) utm.utm_source = params.get('utm_source'); if (params.get('utm_medium')) utm.utm_medium = params.get('utm_medium'); if (params.get('utm_campaign')) utm.utm_campaign = params.get('utm_campaign'); return utm; } function getVal(form, label) { var hyphenated = label.replace(/\s+/g, '-'); var el = form.querySelector('[name="' + label + '"]') || form.querySelector('[name="' + hyphenated + '"]'); return el ? el.value.trim() : ''; } function getValStartsWith(form, prefix) { var el = form.querySelector('[name^="' + prefix + '"]'); return el ? el.value.trim() : ''; } function handleSubmit(e) { var form = e.target; var firstName = getVal(form, 'First name'); var lastName = getVal(form, 'Last name'); var company = getVal(form, 'Company name'); var role = getVal(form, 'Your role'); var level = getValStartsWith(form, 'Job'); var extra = getValStartsWith(form, 'Anything'); var messageParts = []; if (company) messageParts.push('Company: ' + company); if (role) messageParts.push('Role: ' + role); if (level) messageParts.push('Job Level: ' + level); if (extra) messageParts.push(extra); var data = Object.assign({ name: (firstName + ' ' + lastName).trim(), email: getVal(form, 'Email address'), phone: getVal(form, 'Phone'), subject: getValStartsWith(form, 'What'), message: messageParts.join('\n') || '(no message)', }, getUTM()); // Fire and forget — let Webflow handle its own submission normally fetch(CS_ENDPOINT, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': CLEARSITE_KEY }, body: JSON.stringify(data), }).catch(function (err) { console.error('[ClearSite]', err); }); } function init() { document.querySelectorAll('.w-form form').forEach(function (form) { form.addEventListener('submit', handleSubmit); }); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', init); } else { init(); } })();