Testing and validation
Here is some useful information to help you with testing and validation.Using the Chrome Extension
- Install the Voyado Chrome Extension
- Navigate to your website
- Wait for the page to fully load
- Click the Voyado extension icon
- Verify that the script is detected
Browser Console Checks
Use this URL parameter to activate debug mode:- The script loaded successfully: typeof redeal === ‘function’ — Should return: true
- The widget is open: typeof IsRedealOpen === ‘function’ && IsRedealOpen(‘cornerwidget’) — Should return: true if cornerwidget is open
- There are script errors: Look for red errors in the console. Common issues:
- Failed to load resource: https://static.redeal.se/widget/js/redeal.js - Script blocked by firewall/CSP
- redeal is not a function – Script not loaded or loaded after trigger call
Clear testing session
Use this URL parameter to reset your test session:Testing checklist
- Script loads on all intended pages
- Only one script call loads per pageview
- Cornerwidget appears on landing pages
- Cornerwidget does NOT appear on checkout/cart pages
- Open widgets close when navigating to checkout (SPAs only)
- Checkout tag fires on order confirmation with correct data
- Login tag fires when user logs in
- Console shows no JavaScript errors
- All GTM variables return expected values
- Onsite message URL links work and trigger onsite messages
- Onsite messages only trigger on configured domains
- Test with ?voyado-clear to simulate new visitors
Network tab verification
In browser DevTools > Network tab:- Filter by “redeal”
- Verify redeal.js loads successfully (Status: 200)
- Check that POST requests to Voyado API return 200 status
- Verify request payloads contain expected data
Troubleshooting
Here are some tips to help with trouble-shooting of onsite messaging.Script not loading
Symptoms:- Chrome extension shows no detection
- typeof redeal returns undefined
- No network requests to static.redeal.se
- Content Security Policy (CSP) blocking the script
- Ad blocker or privacy extension
- Firewall blocking external scripts
- Incorrect GTM trigger configuration
- Script tag syntax error
Widget not appearing
Symptoms:- Script loads but no widget visible
- Console shows no errors
- Domain not configured in Onsite Manager
- Onsite message not active
- Onsite message already shown to this user
- Wrong tag name
- Z-index conflict
Conversion not tracking
Symptoms:- Checkout tag fires but conversions don’t appear in reports
- Variables returning null or undefined
- Incorrect data types
- Currency code format
- Race condition (script triggers before GTM variables populate)
GTM variables not populating
Symptoms:- GTM Preview shows undefined or null variable values
- Verify dataLayer structure matches your variable configuration
- Check that dataLayer.push() happens before page load events
- Use “Data Layer Variable” type (not “JavaScript Variable”) in GTM
- Test dataLayer in console: console.log(dataLayer)
SPA issues
Widget persists on checkout page:- Ensure Hide tag is implemented and triggering correctly
- Verify Hide tag trigger uses same event type as other triggers
- Check GTM Preview to confirm Hide tag fires
- Confirm Cornerwidget tag triggers on virtual pageviews
- Verify history change events are captured in GTM
- Check that custom events fire consistently
- Ensure if (typeof redeal !== ‘function’) wrapper is present
- Check GTM Preview for duplicate tag fires
Console error messages
Common errors and solutions:| Error | Cause | Solution |
|---|---|---|
| Failed to load resource: https://static.redeal.se/… | Script blocked | Check CSP, firewall, ad blockers |
| redeal is not a function | Script not loaded before call | Ensure script loader runs first |
| IsRedealOpen is not defined | Script not fully initialized | Add conditional check: typeof IsRedealOpen === ‘function’ |
| Cannot read property ‘email’ of undefined | Missing data object | Verify GTM variables are defined |
Performance & security
Performance and security can be improved by following these tips.Content Security Policy (CSP)
If your site uses CSP headers, add these directives:Script loading strategy
The Voyado script uses async loading to minimise performance impact:- Non-blocking: Page rendering continues while script loads
- Fast: Script hosted on CDN with global distribution
- Cached: Browser caches script for subsequent visits
- Initial load: ~15-25 KB (minified and gzipped)
- Subsequent loads: 0 KB (cached)
- Page load delay: <50 ms on average
Best practices
Do:- Load script on all relevant pages (cornerwidget is reusable)
- Use async loading (included in implementation)
- Implement proper CSP directives
- Test on staging before production
- Monitor console for errors after deployment
- Block page rendering waiting for script
- Load script multiple times on same page (use conditional checks for SPAs)
- Hardcode customer data in JavaScript (security risk)
- Skip testing on different browsers
- Forget to update CSP when implementing
Data privacy
Email handling:- Emails are transmitted over HTTPS
- Never expose emails in URLs (use POST data)
- Comply with GDPR/privacy regulations in your region
- Inform users about data collection in your privacy policy
- Script uses local storage and session storage
- Data is stored client-side only
- Use ?voyado-clear to manually clear stored data
Browser compatibility
The script is compatible with:- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Mobile browsers (iOS Safari, Chrome Mobile)
- Internet Explorer 11 and earlier