Skip to content
trackrift

Documentation

SDK

Global bundle (sdk.js)

window.trackrift for CMS and legacy sites without bundlers.

AI brief: Script src https://api.trackrift.com/sdk.js with data-endpoint, data-public-id, data-auto-pageview, data-autocapture. Exposes window.trackrift.track(). Use data-track-ignore for exclusions.

The global bundle loads the full SDK via a single script tag. Ideal for WordPress, Webflow, Squarespace, and marketing pages maintained by non-developers.

global.html
<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

AttributeDefaultDescription
data-endpointrequiredCollector URL
data-public-idrequiredWorkspace public id
data-auto-pageviewtrueFire page_view on load
data-autocapturetrueEnable behavioral capture
data-consent-modeinternalinternal | required
data-debugfalseConsole logging
custom-events.html
<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.