Utils
Utils are re-usable functions to standardize and simplify tracking setups. They vary from simple helper functions to more complex ones for session handling. They are used in walkerOS itself and can be used in custom tracking setups as well. Simple functions are grouped on the Helper page, more complex ones have their own pages.
Installation
There are multiple ways to install and use the utils.
NPM
$ npm install @elbwalker/utils
CDN
There are multiple build files available. Bundled with all functions, grouped
only for the core or web, and separated into individual files. The es5
files
can be used in older browsers as well as the GTM.
- Scripts
- Module
<script src="https://cdn.jsdelivr.net/npm/@elbwalker/utils@latest/dist/web.js"></script>
Load the .mjs
module-file directly from the CDN or your own server.
<script type="module">
const Utils = ( await import(
'https://cdn.jsdelivr.net/npm/@elbwalker/utils@latest/dist/web.mjs' ) );
console.log('id', Utils.getId())
</script>
info
Be aware of the latest
version in the URL, better use a specific version like
3.0.0