Quick start
Add the TayStack script to your site, where to put it, and how to check in your browser that events are being received.
1. Add your site
Sign in, open Sites, and use the Add a site form with your domain. Open the site and the Install card shows the snippet with your own site id, and a Copy snippet button. Sign-up is not open yet: join the waitlist on the home page and we will email you when your invite is ready. Existing accounts can sign in.
2. Paste the snippet
This is the line the Install card generates, with a placeholder site id and domain. Use the one from your dashboard, not this one.
<script defer data-website-id="site_abcd1234efgh" data-domain="example.com" src="https://www.taystack.com/js/script.js"></script>Put it inside <head> on every page of your site, once. It uses defer, so it does not block rendering. The attributes:
data-website-id: your site id. Required.data-domain: the domain you registered. Required. The script only sends events from that domain, itswww.form and its subdomains.data-allow-localhost: set totrueto also tracklocalhost,127.0.0.1and[::1]. See Troubleshooting.data-api-url: where events are sent. Only needed with a proxy. See Proxy setup.data-track-outbound: optional. Sends anoutbound_clickevent when a visitor clicks a link to another site (the address without its query string or fragment). A leadingwww.is ignored; other subdomains count as outbound. Present with any value turns it on;"false"turns it off.data-track-downloads: optional. Sends afile_downloadevent with the file path and extension when a visitor clicks a link to a common download type (for example pdf, zip, docx, xlsx, csv, mp3, mp4).
Note: If data-website-id or data-domain is missing, the script does nothing and says nothing. It never throws into your page.
3. Check that it works
- Open a page of your site (on your real domain, not localhost).
- Open your browser developer tools, go to the Network tab and filter by
events. - Reload. You should see a
POSTrequest to/api/eventswith status202. - Open your site in the dashboard. The visitors-now count updates about every 15 seconds; refresh the rest of the dashboard to see the visit in the totals.
What 202 means: The endpoint answers 202 to any well-formed request, including one for an unknown site id and one from a bot. So 202 shows the request arrived, not that the event was stored. If the dashboard stays empty, see Troubleshooting.
What happens next
- The script sends a pageview when a page loads.
- Route changes in single-page apps are recorded too: Single-page apps.
- Your own events: Custom events.