Wix
Add one script in Wix Custom Code and every page records visits in Databuddy.
Add the script
Open Custom Code
In your website's dashboard, go to Settings → Custom Code and choose Add Custom Code. Custom Code needs a premium plan and a connected domain.
Paste the script
<script
src="https://cdn.databuddy.cc/databuddy.js"
data-client-id="YOUR_CLIENT_ID"
crossorigin="anonymous"
async
></script>Your Client ID is in the Databuddy dashboard under your website's Settings → General.
Choose where it loads
Databuddy follows Wix's page changes itself, so it only needs to load once. Choose Apply.
Open your live website in a private window and visit a few pages. They appear on your dashboard.
Track a link or button click
Wix doesn't let you add attributes to its elements, so listen for clicks by link address instead. Add this as a second Custom Code snippet, also on All pages in Body - end:
<script>
document.addEventListener("click", function (event) {
var link = event.target.closest('a[href*="/book"]');
if (!link) return;
window.databuddy?.track("book_click", {
page_path: window.location.pathname,
});
});
</script>Change /book to part of the address your button links to. The listener sits on the whole page, so it keeps working as Wix swaps pages.
Turn on more tracking
Add attributes to the script tag:
data-track-outgoing-links
data-track-web-vitals
data-track-errorsRelated
How is this guide?