04 · Tracking
Every attribute the tag reads
The tag needs only data-site. The rest change where events go, how visitors are counted, and when local and automated visits count.
01The tag's attributes
<script defer data-site="k3xq2mfa7twp" src="https://t.tallybyoutpost.com/script.js"></script>data-siterequired- The site's id, from its Setup page. DataFast's
data-website-idis read the same way. data-modecookiecookielessconsent- How visitors are counted (Privacy modes). Without it, cookie mode. Any other value counts as cookieless, so a typo never sets cookies the site didn't ask for.
data-apipath or address- Where events go: by default
/api/eventon the script's own address. A path is resolved against the page, for a proxy on your own domain (Serving it from your domain). data-hashflag- A change of
location.hashalone is a new page, for apps that route after a#. data-allow-localhostflag- Send events from
localhost,127.0.0.1,*.localhost,*.localandfile://pages (Testing on localhost). DataFast'sdata-allow-localhost="true"works too. data-allow-automationflagtests only- Send events from a browser driven by automation (WebDriver, Playwright, Puppeteer). Leave it off on your live site.
deferkeep it- Loads the script without holding up the page.
A flag is on when present, unless its value is false.
02The calls your page can make
// Calls made before the script loads wait in a queue:
window.tally = window.tally || function () { (tally.q = tally.q || []).push(arguments); };
tally('signup', { plan: 'pro' }); // a goal, with properties
tally('identify', { email: user.email }); // match payments by email
tally('consent', true); // consent mode: the banner said yes
tally('consent', false); // ...or no
Each call fails quietly: it never throws into your page. window.datafast(…) is the same function. Goals and identify has the rules for names.
03Examples
<script defer data-site="k3xq2mfa7twp" data-mode="consent" src="https://t.tallybyoutpost.com/script.js"></script><script defer data-site="k3xq2mfa7twp" data-hash src="https://t.tallybyoutpost.com/script.js"></script><script defer data-site="k3xq2mfa7twp" src="/js/script.js"></script><script defer data-site="k3xq2mfa7twp" data-allow-localhost src="https://t.tallybyoutpost.com/script.js"></script>04What it sends
| Event | When |
|---|---|
pageview | The page loads, and each route of a single-page app. |
engage | Engaged time and scroll depth: when the page is hidden or left, at a route change, and every 30 seconds while someone is reading. |
goal | A goal, from a call or a click. |
outbound | A click on a link to another host. |
identify | An email to match payments by. |
Each is one small JSON request, sent without cookies; anything over 8 KB isn't sent. A page opened in the background by prerendering counts once someone actually opens it.
05When it sends nothing
- There's no
data-site, or no address to send to (a copy of the script pasted inline withoutdata-api). - The page is on localhost without
data-allow-localhost, or the browser is automated withoutdata-allow-automation. - The browser has opted out with
localStorage.datafast_ignore = true.
Your page's calls still work then: they do nothing.
06What it doesn't read
Something missing, or not what you see? Write to support@tallybyoutpost.com and say which page.