Install on Wix
A Custom Code entry in your Wix settings counts every page, with no Wix app to install.
Before you paste anything
Every snippet below shows YOUR-SITE-ID
. Replace it with your own site id, which is on the Tracking Code page of the site in your account.
If you do not have an account yet, creating one and adding your domain takes about a minute.
Add the snippet as Custom Code
- In your Wix dashboard, go to Settings, then Custom Code, under Development & Integrations.
- Click + Add Custom Code, and paste the snippet into the code box.
- Set Add Code to Pages to All pages, and Place Code in to Head.
- Where Wix asks how often to load it, choose Load on each page, then apply the change and click Publish on your site.
<script>
(function () {
// Ensure this only runs in a browser environment.
if (typeof window === 'undefined' || typeof document === 'undefined') {
return;
}
var siteId = 'YOUR-SITE-ID';
var trackingDomain = 'www.veritametrics.com'; // 1. Initialize the Async Command Queue
// This ensures window.verita() is available immediately.
window.verita =
window.verita ||
function () {
(window.verita.q = window.verita.q || []).push(arguments);
};
window.verita.l = new Date().getTime(); // 2. Load the enhanced tracker script asynchronously.
// It will process the command queue once loaded.
var script = document.createElement('script');
script.src = 'https://' + trackingDomain + '/api/tracker.js?siteId=' + siteId;
script.async = true;
script.defer = true;
script.dataset.siteId = siteId;
script.dataset.trackingDomain = trackingDomain;
document.head.appendChild(script); // 3. Send the initial pageview using the *queue*
window.verita('trackPageView');
})();
</script>
<noscript>
<img
src="https://www.veritametrics.com/api/track-pageview?siteId=YOUR-SITE-ID"
referrerpolicy="unsafe-url"
alt=""
width="1"
height="1"
style="display: none"
aria-hidden="true"
/>
</noscript> Note: The other choice, Load once per visit, only runs the snippet on the first page a visitor opens, so every page after it goes uncounted with no error shown anywhere. We have not verified this install end to end on a live Wix site; the steps above follow Wix's own Custom Code documentation.
Check that the data is arriving
- Open your site in a browser and load any page.
- In VeritaMetrics, open the site and click Tracking Code in the sidebar. The status turns active and your visit appears in the recent-pageviews list within a few seconds.
If you're comfortable checking yourself: open your browser's developer tools (right-click the page and choose Inspect, or press F12), open the Network tab, and reload. A working install shows a request to /api/tracker.js succeed (status 200), then a second request when you move the mouse or scroll.
Custom Code does not run in the editor or the preview
Wix strips custom code from the editor and from preview mode, so the snippet only runs on the published site. Check the live URL rather than the preview, and publish after any change to the code box.
Guides for other platforms
The same install, on a different stack.
Explore the documentation
Jump to another guide.