Skip to the page

Developer GuideTracking

Data attributes

Reference for the HTML attributes the Venbit tracker reads, including data-track, data-venbit-private, data-venbit-form and data-venbit-form-kind.


Five HTML attributes change what the tracker records on a page. One labels a click, two keep typed values private, and two describe forms. You don't need any of them, and most of what Venbit counts works with no attributes at all.

HTML
<button data-track="Get a free roof inspection">Start</button>
<input name="gate-code" data-venbit-private>
<div data-venbit-form="quote">...</div>
<form data-venbit-form-kind="search">...</form>

They all go on elements in your page. Attributes for the tracker's own script tag (data-site, data-mode, data-endpoint, data-allow-local) live in Install the tracker.

Reference

AttributeGoes onValueEffect
data-trackAny elementA label, up to 80 charactersA click on the element, or anything inside it, is recorded as a call to action under that label.
data-venbit-privateA field, or any element around fieldsNoneWhat's typed in those fields is never captured.
data-capture="off"A field, or any element around fieldsoffThe same as data-venbit-private. On the tracker's script tag it turns value capture off for the whole site.
data-venbit-formA container that acts as a form, or an <iframe>A name for the formTreats the container as one form. On an iframe, lets the framed form report its result to the page.
data-venbit-form-kindA <form> or a data-venbit-form containerenquiry, search or furnitureSays what the form is for, which decides whether a send is a lead.

data-track

Marks a click as a call to action and gives it a label you choose.

HTML
<a href="/quote" data-track="Hero: get a quote">Get started</a>

<div class="plan-card" data-track="Plan card: Gold" role="button" tabindex="0">
  <h3>Gold</h3>
  <p>Full roof replacement</p>
</div>

Clicks on links and buttons get recorded anyway, labelled with the element's visible text. If that text or the address reads like a call to action ("Get a quote", "Book now", a link to /contact), it's marked as one automatically. Reach for data-track when:

  • the element isn't a link or a button, so its clicks wouldn't otherwise be recorded as a step,
  • the visible text is unclear or repeated ("Learn more" five times on a page),
  • you want a label that holds steady when the wording changes.

The click shows up under its label as a step in the visitor's trail. A goal of the kind A link or button counts it when the label contains the goal's text, so a goal on get a quote matches data-track="Hero: get a quote".

Phone links, email links, outbound links and file downloads keep their own type even with data-track on them. A tel: link is always a phone tap.

For a whole site's calls to action, hand this to a coding agent:

Add Venbit data-track labels to this site's main calls to action. Put data-track="Section: action" (up to 80 characters, e.g. "Hero: get a quote") on hero and pricing buttons, on clickable cards or other elements that aren't links or buttons, and on links with vague repeated text like "Learn more". Keep labels stable if the visible wording changes later. Skip tel:, mailto:, outbound and download links, which keep their own type. List every label you added.

data-venbit-private

Keeps a field's value out of everything the tracker captures. Put it on a single field, or on a wrapper to cover every field inside.

HTML
<form id="service-request" name="service-request">
  <label>Name <input name="name" autocomplete="name"></label>
  <label>Phone <input name="phone" type="tel" autocomplete="tel"></label>

  <label>Gate code <input name="gate-code" data-venbit-private></label>

  <fieldset data-venbit-private>
    <legend>Insurance</legend>
    <label>Insurer <input name="insurer"></label>
    <label>Policy number <input name="policy"></label>
  </fieldset>

  <button type="submit">Request service</button>
</form>

That send still counts as a lead. You'd see name and phone on it, and nothing from the gate code or insurance fields.

Some fields are never captured whether or not they carry the attribute: password fields, card number, security code and expiry fields, social security numbers, CAPTCHA tokens, and hidden and file inputs.

data-capture="off"

Put on a field or a wrapper, it does the same job as data-venbit-private.

HTML
<label>Date of birth <input name="dob" type="date" data-capture="off"></label>

On the tracker's script tag it applies site-wide. No typed value is captured on any form, and the name and email passed to venbit('signup'), venbit('subscribe') and venbit('purchase') get dropped too. Form sends are still counted, with no contents.

HTML
<script defer crossorigin="anonymous" src="https://vnbt.app/m.js?s=KEY" data-site="KEY" data-capture="off"></script>

KEY is your site's key, found under Settings, then Tracking in the dashboard. Privacy controls covers this switch in more depth.

data-venbit-form

Tells the tracker a container is a form when there's no <form> element, and gives the form a stable identity.

HTML
<div id="quote" data-venbit-form="quote" aria-label="Quote request">
  <input name="email" type="email" placeholder="Email">
  <input name="phone" type="tel" placeholder="Phone">
  <button type="button">Get my quote</button>
</div>

Three things follow from it. Fields inside the container are grouped as one form, the same as fields inside a <form>. The value becomes the name you pass to venbit('form_success', 'quote', ...) and the other form calls. And a multi-step form whose steps replace one another stays one form when every step carries the same value, so values from earlier steps are kept.

On an <iframe>, the attribute lets a form hosted on another origin report its result to the page:

HTML
<iframe src="https://forms.harborroofing.example/contact" data-venbit-form="contact"></iframe>

Form tracking describes the message the framed page sends.

data-venbit-form-kind

Overrides what the tracker decided a form is for.

ValueMeaningA send is a lead
enquiryThe visitor is asking the business for something.Yes
searchA search box.No
furnitureNewsletter sign-up, log-in, cart, coupon, filter, sort and similar.No
The value you set decides whether a send counts as a lead
HTML
<!-- never count the store locator as a lead -->
<form action="/stores" data-venbit-form-kind="search">
  <input name="postcode" placeholder="Postcode">
  <button>Find a store</button>
</form>

<!-- a one-field callback form that should count -->
<form id="callback" data-venbit-form-kind="enquiry">
  <input name="phone" type="tel" placeholder="Your number">
  <button>Call me back</button>
</form>

Any other value gets ignored, and the tracker decides on its own.

Tracked with no attributes

WhatHow it's recognisedRecorded with
Page viewsPage loads and single-page route changesThe path and the page title
Phone tapsA click on a tel: linkThe number, and the link's text
Email clicksA click on a mailto: linkThe address, and the link's text
Outbound linksA click on a link to another host (www is ignored when comparing)The destination host and path
DownloadsA click on a link to a .pdf, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .zip, .csv, .mp4 or .mp3 fileThe file name
Links and buttonsA click on any other <a> or <button>The visible text, up to 80 characters
Scroll depthReaching 25%, 50%, 75% and 100% of the pageThe milestone
FormsSee Form trackingThe form's name, and its values unless capture is off
Missing pagesA page the server answers with 404 or 410The path

For the full list of what is and isn't collected, see What the tracker collects.

Common questions

Do I need data-track for Venbit to count button clicks?

No. Any link or button click is recorded with its visible text, and ones that read like a call to action are marked as one automatically. Use data-track for elements that aren't links or buttons, for unclear text, or when you want a label that stays put.

How do I hide a form field from Venbit?

Add data-venbit-private to the field, or to an element around several fields. Whatever's typed there is never captured, and the send still counts as a lead.

How do I stop Venbit counting a search form as a lead?

Add data-venbit-form-kind="search" to the form. Searches and site furniture such as log-ins and newsletter sign-ups are never leads. Only enquiry forms are.

Last updated . Something wrong or missing on this page? Tell us from Settings, then Support.