Installation & setup

The tracking snippet

The whole installation is one line: a deferred script under 1KB. This article explains each attribute, where the tag goes, and the optional settings most sites never need.

6 min read Updated June 2026 Installation & setup
<script defer src="cdn.bobray.com/b.js">

The snippet

<script defer data-site="YOUR_SITE_ID" src="https://cdn.bobray.com/b.js"></script>

Paste it into the <head> of every page, or your site-wide layout/template so it appears once. defer means it never blocks rendering; your Core Web Vitals are unaffected.

Attribute reference

Where it must not go

Not in the <body> footer (late loads undercount fast bounces), not inside a tag manager that itself waits for consent (BobRay needs no consent, wrapping it in a consent gate only loses you data), and not duplicated, two copies double-count.

Confirming it works

Follow Verifying your installation. The request you should see in DevTools is a single POST to api.bobray.com/e per pageview, around 300 bytes.

Common pitfalls

The mistakes we see most often on this topic, so you can skip them entirely.

Quick reference

Weight< 1 KB, deferred
Required attrdata-site only
Beacon size~300 bytes per view
Placement, once, site-wide
Did this solve it? If not, write to support with your site ID, a real person replies within one business day.