Onsite uses pop-ups, banners, and referral widgets on your website to capture leads, to segment visitors, and to activate offers It taps into real-time behavior to make your site more dynamic and personal.Here is how you configure and work with onsite messaging in Engage.
Single Page Applications require special handling because page navigation doesn’t trigger traditional page loads. For example, if your trigger uses custom pageload events, your exceptions must also use custom pageload events. Mixing event types (e.g., history change with pageview exceptions) will cause failures.Other aspects of SPAs:
Navigation happens without full page reloads
Scripts must trigger on virtual page views
Open widgets persist during navigation and must be explicitly closed
All triggers must use consistent event types
You’ll need to create four tags. Suggested names are:
Voyado Onsite Cornerwidget - Displays messaging widgets across the website
Voyado Onsite Hide - Closes any open widgets on checkout/cart pages
Voyado Onsite Purchase - Tracks conversions and displays messages on order confirmation page
Voyado Onsite Login - Identifies user and enables personalized messaging onsite
Purpose: This loads and displays messaging widgets on landing pages and virtual page views.Trigger: All pageviews EXCEPT checkout, cart, and order confirmation pages. Should also be excluded when the login script is called instead.
The (typeof redeal !== ‘function’) check prevents the script from being loaded multiple times on SPAs. The script loader only runs once, but redeal(‘cornerwidget’) can be called on each virtual page load.
Configuration in GTM:
Tag Type: Custom HTML
Trigger: Custom Event on page load
Exceptions: Checkout page, Cart page, Order confirmation page and Login event
Alternative tag names:Replace “cornerwidget” with any tag name configured in Onsite Manager. Use multiple tags with different conditions to trigger different onsite messages.
Purpose: Close open widgets when users navigate to pages where widgets shouldn’t appear (checkout, cart).On SPAs, excluding pages from the “Voyado Onsite Cornerwidget” tag only prevents NEW widgets from loading; it doesn’t close widgets that are already open. This tag explicitly closes them.Trigger: Pageview on checkout and cart pages.
total = full amount paid by customer (including tax, shipping, fees)
revenue = amount excluding tax, shipping, and fees
coupons should be an array even if there is only one code
Missing or null values won’t break functionality but will limit tracking and reporting
Optional fields: name, phone (useful for prefilling onsite messages and automatically identifying visitors)
Configuration in GTM:
Tag Type: Custom HTML
Trigger: Custom Event associated with reaching the order confirmation page, for example “purchase”, or when Page Path contains “/order-confirmation” or “/thank-you”
Purpose: Identifying unidentified visitors and triggering personalized onsite messagesWhen to trigger:
When a user actively logs in (login button click)
On page load if user is already logged in (“soft login”)
Trigger: Login event OR pageview when user is authenticated
The login script should only be called once per session, and not on any subsequent page views after the login event occurs. On subsequent page views, calling the cornerwidget script instead is expected.
For traditional multi-page applications (non-SPAs), the implementation is simpler because each page navigation is a full page load.The main differences from the SPA implementation are:
No need for the if (typeof redeal !== ‘function’) check
No need for the Hide tag (widgets don’t persist across page loads)
For sites without GTM, or when you want full control, you can add the script directly to your HTML.Place this code immediately after the opening <body> tag on all pages where messaging should appear:
{ email: "user@example.com", // Optional: User email phone: "+46701234567", // Optional: User phone contactId: "b9a02dc6-52b8-4e11-b929-b37500f002f1" // Optional: User's Contact ID in Engage}
It is optional which of the above field(s) to pass in the script call, but at least one needs to be passed for script identification upon login to work.
A/B Testing: If multiple onsite messages use the same script tag and fulfil any additional targeting criteria needed to be displayed, one will be randomly selected and displayed to the user.
Each onsite message in Onsite Manager generates an onsite message URL link as well as a QR code. Use these links in emails or social media to drive traffic to your website and trigger the appropriate onsite messages automatically.With personalization variables (for email marketing):
Onsite messages only trigger on domains configured in Onsite Manager.
Use these:Production domain: www.example.comTest subdomain: test.example.comDo not use these:Local development: localhost or 127.0.0.1IP addresses: 192.168.1.100For testing on non-production domains, add the test domain to your site configuration in Onsite Manager.