Documentation

Install SourceTrace

Add one script to your site to start tracking AI referrals, SEO positions, and product analytics.

Universal snippet

<script src="https://app.sourcetrace.xyz/t.js" data-key="YOUR_API_KEY" async></script>

Replace YOUR_API_KEY with the key from Settings → Sites, then drop it before </head>.

Options and calls

data-auto="true"

Records clicks on links and buttons, rage clicks, form submits (field count only, never what people type), scroll depth, engaged time and page errors. Add data-st-ignore to any element to leave it out.

data-persist="true"

Keeps a lasting visitor id in localStorage so returning visitors are recognised. Off by default because it usually needs the visitor's consent.

data-use-cookies="false"

Keeps campaign tags (utm_*) in the tab only, no cookie.

data-endpoint="/your/path"

Send events through your own server path instead of SourceTrace's address.

ST.convert('purchase', 49.00)

Records a conversion with its value (in your currency; stored in cents). AI-referred visits are credited with the revenue.

ST.track('signup', { plan: 'pro' })

Records a custom event with your own properties.

ST.identify('user-123', { plan: 'pro' })

Links this visitor's past and future visits to your own user id.

Privacy: no cookies unless campaign tags are present, no lasting id unless data-persist is set, no input values ever. Visits from AI tools are recognised from the referrer and from utm_source.

Platform guides