@mapbox/segmentio-insert

insert segment.io script on a page

Usage no npm install needed!

<script type="module">
  import mapboxSegmentioInsert from 'https://cdn.skypack.dev/@mapbox/segmentio-insert';
</script>

README

segmentioInsert

Load segment.io snippet on this page, given an apiToken as a string. This does the same thing as the official snippet, but is designed for usage with browserify and hardcodes https:// instead of matching the page's scheme.

Parameters

  • apiToken string

Examples

var segmentInsert = require('@mapbox/segmentio-insert')
segmentInsert('my-api-token');

Returns analytics