Plain HTML Integration
The simplest way to add qvctrs. Works with any static site, vanilla JavaScript, or HTML page.
Installation
Step 1: Copy the snippet
Add this code to your HTML, just before the closing </head> tag:
<script>
window.qvctrs=window.qvctrs||{};window.qvctrs.q=window.qvctrs.q||[];
window.qvctrs.init=window.qvctrs.init||function(){window.qvctrs.q.push(['init'].concat(Array.prototype.slice.call(arguments)))};
window.qvctrs.init({siteId:'YOUR_SITE_ID'});
</script>
<script src="https://www.qvctrs.com/qvctrs-sdk-v2.js" async></script>Step 2: Replace YOUR_SITE_ID
Get your Site ID from your dashboard and replace YOUR_SITE_ID in the snippet.
Step 3: Deploy
Upload your updated HTML file. That's it!
Complete Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Website</title>
<!-- qvctrs SDK -->
<script>
window.qvctrs=window.qvctrs||{};window.qvctrs.q=window.qvctrs.q||[];
window.qvctrs.init=window.qvctrs.init||function(){window.qvctrs.q.push(['init'].concat(Array.prototype.slice.call(arguments)))};
window.qvctrs.init({siteId:'qv_your_site_id_here'});
</script>
<script src="https://www.qvctrs.com/qvctrs-sdk-v2.js" async></script>
</head>
<body>
<h1>Welcome to my site!</h1>
</body>
</html>Loading Options
The SDK works with any loading strategy:
Async (Recommended)
Non-blocking, best for performance:
<script src="https://www.qvctrs.com/qvctrs-sdk-v2.js" async></script>
Defer
Loads after HTML parsing completes:
<script src="https://www.qvctrs.com/qvctrs-sdk-v2.js" defer></script>
Synchronous
Blocks page rendering (not recommended, but works):
<script src="https://www.qvctrs.com/qvctrs-sdk-v2.js"></script>
The command queue pattern ensures qvctrs.init() works regardless of which loading method you choose.
Verify Installation
Open your browser's developer console and run:
// Check if SDK loaded console.log(window.qvctrs.version); // Should show "2.4.0" // Check session console.log(__qvctrs_utils.state.sessionId); // Should show a UUID // Check quality score console.log(__qvctrs_utils.getQualityScore().total); // Score 0-100
Checklist
- ✓Snippet added before </head>
- ✓Site ID replaced with your actual ID
- ✓Page deployed to production
- ✓Verified in browser console
Troubleshooting
"qvctrs is not defined"
This error should never happen with the command queue pattern. Make sure the shim script (the first script tag) is present and runs before any code that calls qvctrs.init().
No data appearing in dashboard
- Check that your Site ID is correct
- Verify the domain matches what you registered
- Wait a few minutes for data to sync
- Check browser console for any errors