Official USERDIVE loader from cdn.userdive.com
npm install userdive --save
import factory from "userdive";
// create global entrypoint & load agent.js from cdn
const _ud = factory();
_ud("create", "id", "auto");
_ud("send", "pageview");
import factory from "userdive";
const myTracker = factory("myTracker"); // customize global function name
myTracker("create", "id", "auto");
myTracker("send", "pageview");
more examples
PRs accepted. join us
GPLv3. Full license text is available in LICENSE