SDK
Global bundle (sdk.js)
window.trackrift for CMS and legacy sites without bundlers.
The global bundle loads the full SDK via a single script tag. Ideal for WordPress, Webflow, Squarespace, and marketing pages maintained by non-developers.
<script
src="https://api.trackrift.com/sdk.js"
data-endpoint="https://api.trackrift.com"
data-public-id="YOUR_PUBLIC_ID"
data-auto-pageview="true"
data-autocapture="true"
async
></script>data-* attributes
| Attribute | Default | Description |
|---|---|---|
| data-endpoint | required | Collector URL |
| data-public-id | required | Workspace public id |
| data-auto-pageview | true | Fire page_view on load |
| data-autocapture | true | Enable behavioral capture |
| data-consent-mode | internal | internal | required |
| data-debug | false | Console logging |
<script>
window.trackrift.track('signup', {
properties: { plan: 'trial', source: 'webinar' }
});
document.getElementById('buy').addEventListener('click', function () {
var id = window.trackrift.track('purchase', { value: 99, currency: 'USD' });
// pass id to fbq if Meta pixel present
});
</script>vs Universal Script
u.js is smaller and auto-updates init config from the server. sdk.js is for sites that need programmatic window.trackrift before the loader returns.