File DA-012 View as Markdown
Wix
Settings › Custom Code › Add Custom Code: paste the snippet, then choose All pages, Load code once and Head. Publish.
This needs a Premium plan and a connected domain.
Velo option (needs a public key)
Velo can't read window.doubleagent. Instead, an Embed HTML element (id daFrame, hidden) posts a token to your page code:
window.doubleagent=window.doubleagent||{q:[],push(){this.q.push(arguments)}};
<script async src="https://cdn.doubleagent.so/v1/doubleagent.js" data-key="pk_live_xxx" data-profile="leadgen"></script>
<script>
addEventListener('message', async (e) => {
if (e.data !== 'da:token') return;
parent.postMessage({ daToken: await doubleagent.getToken('lead_form').catch(() => '') }, '*');
});
</script>
Your page code posts da:token with $w('#daFrame').postMessage, and a backend web module verifies the reply with POST /v1/verify.