Opening Chat Inline Instead of a New Window (V20 / Messenger)
The same issue that affects v10 also applies to v20 / Messenger: a custom chat trigger button that calls window.open() opens a brand new browser window with no connection to the page your visitor was on, so any UTM parameters on that page (utm_source, utm_medium, utm_campaign, etc.) never reach the conversation.
<a onclick="window.open('https://app.velaro.com/chat?siteId=YOUR_SITE_ID', '', 'height=350,width=400')">
Live Chat
</a>
The solution: open the already-embedded widget inline
If your embed script loads embed.js (the v20 / Messenger embed, not the v10 shim), use the widget's public expand command from your own button instead of opening a new window:
<a onclick="window.Velaro('expand')">
Live Chat
</a>
Same button, same styling, only the onclick changes. Chat opens inline, on the same page, using the widget already embedded there.
Where the UTM data goes
Once chat opens inline, UTM parameters present on the page at load time are captured automatically and attached to the conversation's custom data, no code required on your end, and no admin setting to turn on, this works out of the box for every v20 site.
- No Google Analytics integration needed to see this data on the conversation itself.
- If you want a GA event fired when chat opens, that is a separate, small script you add yourself listening for the click on your button, independent of the widget call above.
Options summary
| Your goal | What to do |
|---|---|
| Keep chat on the page and stop losing UTM data | Swap window.open(...) for window.Velaro('expand') |
| See which campaign drove a chat | Nothing extra, this is captured automatically |
| Send a GA event when chat opens | Add your own GA/GTM listener on the button click |
Testing this yourself
A live, interactive comparison tool is available at https://v20.velaro.com/inline-chat-utm-test.html. Enter your site ID (and group ID if applicable) and it loads your actual widget, then shows both the window.open button and the inline window.Velaro('expand') version side by side, with a UTM simulator and live UTM display, plus the exact diff to apply to your own button. That page also includes step-by-step instructions for confirming UTM capture yourself via your browser's DevTools Network tab, so you don't have to take it on faith before a real conversation happens.
Backward compatibility
This does not change any existing embed. Sites already using the default Messenger launcher, or already calling Velaro('identify', ...), are unaffected, expand is a new, separate command added alongside the existing ones.
Was this article helpful?