Skip to content

Installation

Add this snippet to your website, just before </body>:

<script>
(function(w,d,s,f,js,fjs){
w.varda=w.varda||function(){(w.varda.q=w.varda.q||[]).push(arguments)};
js=d.createElement(s);fjs=d.getElementsByTagName(s)[0];
js.id='varda-widget-js';js.src=f;js.async=1;fjs.parentNode.insertBefore(js,fjs);
}(window,document,'script','https://api.tryvarda.com/widget/varda-widget.js'));
varda('init', 'YOUR_WIDGET_ID');
</script>

Replace YOUR_WIDGET_ID with your widget ID from Settings > Web Chat.

To enable phone number swapping (DNI) alongside the chat widget:

<script>
(function(w,d,s,f,js,fjs){
w.varda=w.varda||function(){(w.varda.q=w.varda.q||[]).push(arguments)};
js=d.createElement(s);fjs=d.getElementsByTagName(s)[0];
js.id='varda-widget-js';js.src=f;js.async=1;fjs.parentNode.insertBefore(js,fjs);
}(window,document,'script','https://api.tryvarda.com/widget/varda-widget.js'));
varda('init', 'YOUR_WIDGET_ID', { poolToken: 'YOUR_POOL_TOKEN' });
</script>

If you only want phone number swapping without the chat bubble:

<script>
(function(w,d,s,f,js,fjs){
w.varda=w.varda||function(){(w.varda.q=w.varda.q||[]).push(arguments)};
js=d.createElement(s);fjs=d.getElementsByTagName(s)[0];
js.id='varda-widget-js';js.src=f;js.async=1;fjs.parentNode.insertBefore(js,fjs);
}(window,document,'script','https://api.tryvarda.com/widget/varda-widget.js'));
varda('init', 'YOUR_WIDGET_ID', { trackingOnly: true, poolToken: 'YOUR_POOL_TOKEN' });
</script>

The widget works with any tag manager (Google Tag Manager, Cloudflare Zaraz, etc.). Paste the same snippet as a Custom HTML tag.

  1. Go to Cloudflare Dashboard > Zaraz > Tools
  2. Add a Custom HTML tool
  3. Paste the embed snippet
  4. Set the trigger to Pageview

The widget automatically captures marketing attribution on every page load — no configuration needed:

  • UTM parametersutm_source, utm_medium, utm_campaign, utm_term, utm_content
  • Click IDsgclid (Google Ads), fbclid (Meta), msclkid (Microsoft Ads)
  • Referrerdocument.referrer
  • Landing page — First page URL the visitor hit

Attribution is persisted in localStorage with last-non-direct logic — if a visitor returns via a direct visit, their previous attribution is preserved.

When a chat conversation starts, the stored attribution is automatically attached to the conversation.