Integrations
Jekyll
Add an include to your Jekyll layout and every page you publish records visits in Databuddy.
Add the script
Create the include
{% if jekyll.environment == "production" and site.databuddy_client_id %}
<script
src="https://cdn.databuddy.cc/databuddy.js"
data-client-id="{{ site.databuddy_client_id }}"
crossorigin="anonymous"
async
></script>
{% endif %}The script loads only in builds run with JEKYLL_ENV=production, so your local visits aren't counted.
Set your Client ID
databuddy_client_id: "YOUR_CLIENT_ID"Your Client ID is in the Databuddy dashboard under your website's Settings → General.
Include it in your layout
<body>
{{ content }}
{% include databuddy.html %}
</body>Build with JEKYLL_ENV=production jekyll build, deploy, and visit a few pages. They appear on your dashboard.
Track clicks in your posts
Add data-track-attributes to the script tag, then name elements in any post or page:
<a href="/pricing" data-track="pricing_link_click" data-location="post">View pricing</a>Each click sends a pricing_link_click event with location: "post".
Send an event from a page
<script>
document.getElementById("signup")?.addEventListener("click", function () {
window.databuddy?.track("signup_click", { post: {{ page.title | jsonify }} });
});
</script>Turn on more tracking
Add attributes to the script tag in your include:
data-track-attributes
data-track-outgoing-links
data-track-web-vitals
data-track-errorsRelated
How is this guide?