Embed script v12

Our public script is now at v12. You get it automatically with latest.js. If you use SRI, update to the v12 script and hash.

New features

  • Inline events are part of the main script: add data-simple-event to clicks and form submits, with data-simple-event-* attributes as metadata.
  • Optional 404 detection: data-detect-404="true" sends a page_404 event.
  • We collect the names of query parameters that have a value. For example, gclid tells paid from organic traffic. We still only collect values of UTM codes, ref, and allowed parameters. Opt out with data-ignore-metrics="querykeys".
  • Overwrite the referrer with data-referrer or sa_settings.referrer.
  • Optional time on page pings: data-pings="5,60" sends the visible time at those seconds.
  • Automated events collect clicks on phone (tel:) links.
  • Inline and automated events use fetch with keepalive when the browser supports it, with an image request as fallback, so they are more likely to arrive when the visitor navigates away.

Improvements and fixes

  • Time on page is reliable on mobile and only counts visible time.
  • Automated events no longer block or delay links: Cmd, Ctrl, and middle clicks work, and there’s no 5 second delay.
  • Automated events work with a custom namespace and skip links with data-simple-event.
  • Visitors arriving through a Cloudflare challenge are counted as unique.
  • Ignoring scrolled no longer drops the screen size.
  • Manual page views with a different query string are no longer merged.
  • data-allow-params is case-insensitive.
  • Fixed false bot detection with the Phantom wallet extension.
  • Removed the retired Cloudflare app build.

If you are a developer you might want to see what changed in our open-source repository.