HTML / CDN

Add Produl to any site with a single script tag. No build step, no dependencies.

Script tag

Paste this snippet before </body> on every page, replacing SITE_API_KEY with the public API key from your dashboard. The defer attribute means the script loads after the page without blocking rendering.

html
<script defer data-site="SITE_API_KEY" src="https://app.produl.tech/tracker.min.js"></script>

Data attributes

All tracker options can be set as data-* attributes on the script tag. No JavaScript configuration is needed for the standard hosted install.

AttributeRequiredDescription
data-siteYesYour public site API key from the dashboard.
data-endpointNoAdvanced. Override the Produl server base URL for self-hosted or proxied deployments. Defaults to the script's own origin.
html
<!-- advanced: custom Produl server base URL -->
<script defer
  data-site="SITE_API_KEY"
  data-endpoint="https://analytics.example.com"
  src="https://app.produl.tech/tracker.min.js"></script>

Custom events

The tracker exposes window.ma.track() for sending custom events after it loads. If you need to fire events before the script finishes loading, push commands onto window.maq; they are replayed once the tracker initializes.

html
<script>
  window.maq = window.maq || []

  // Track a custom event with optional properties
  window.maq.push(['track', 'signup', { plan: 'pro' }])
</script>

<script defer data-site="SITE_API_KEY" src="https://app.produl.tech/tracker.min.js"></script>