Prerequisites
Before you start you will need these things to be in place:1
Google Tag Manager
If your’re using Google Tag Manager (GTM) you’ll need to have it correctly installed on your website.
See the GTM Installation Guide
2
Access to GTM container
You’ll need access to your GTM container with publish permissions.
3
Access to your dataLayer or variables
You’ll also need access to your website’s dataLayer or variables for:
- Order totals and revenue
- Customer email addresses
- Currency codes
- Discount/coupon codes
4
Test environment
A test environment is needed to validate implementation
5
Voyado Chrome extension
And, optionally, the Voyado Chrome extension installed for testing
Implementation paths
Here we will consider three ways to implement Onsite:- Via Google Tag Manager in SPAs (single page applications)
- Via Google Tag Manager in traditional multi-page applications
- Via direct implementation
1- Google Tag Manager - SPA
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
- 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
Tag 1: Voyado Onsite Cornerwidget
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.Voyado Onsite Cornerwidget Script
- Tag Type: Custom HTML
- Trigger: Custom Event on page load
- Exceptions: Checkout page, Cart page, Order confirmation page and Login event
Tag 2: Voyado Onsite Hide
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.Voyado Onsite Hide script
- Tag Type: Custom HTML
- Trigger: Custom Event on page load when Page Path contains “/checkout” or “/cart”
Tag 3: Voyado Onsite Purchase
Purpose: Track conversions and optionally trigger post-purchase onsite messages. Trigger: Order confirmation page load (immediately after purchase).Voyado Onsite Purchase script
Expected output:
- 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”
Tag 4: Voyado Onsite Login
Purpose: Identifying unidentified visitors and triggering personalized onsite messages When to trigger:- When a user actively logs in (login button click)
- On page load if user is already logged in (“soft login”)
Voyado Onsite Login script
- userEmail - User’s email address (unhashed string)
- phone: userPhone – User’s phone number
- contactId: contactID – User’s contact ID in Voyado Engage
- Tag Type: Custom HTML
- Trigger: Custom Event user_login OR first page view when User State = “logged_in”, expected to fire only once per session
- Enables automated consent updates via Reach Ability feature
- Triggers onsite messages to complete missing profile data
- Improves contact data quality
- Improves onsite scripts user identification
2 - Google Tag Manager (traditional)
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)
Tag 1: Cornerwidget (Traditional Sites)
Cornerwidget (Traditional Sites) script
Tag 2: Purchase (Traditional Sites)
Purchase (Traditional Sites) script
Tag 3: Login (Traditional Sites)
Login (Traditional Sites) script
3 - Direct implementation
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:Direct implementation script
Cornerwidget (landing pages)
Cornerwidget (landing pages) script
Cornerwidget (landing pages) with refill script
Checkout (order confirmation page)
Checkout (order confirmation page) script
Login (login page or when user is authenticated)
Login script
Hide function (SPAs only)
Hide function script
Script reference
Standard tag namesData field specifications
Checkout fields
Cornerwidget fields (all optional)
Login fields
Custom trigger tags
You can define custom tags in Onsite Manager and trigger them:Trigger custom tag
Hide function
Basic usage (hide all open widgets):Hide all open widgets

