/swiv/ (haitian creole) - Follow, track.
Swiv is a JavaScript library that makes website tracking implementation easier. It procures a fluent and modular API to send data to Google analytic systems, such as Analytics, Tag Manager, and Enhanced Ecommerce. It is dependency-free, back-end agnostic, with the possibility to replace any legacy singleton within the core by our own. It can be implemented anywhere, from a VanillaJS environment to a PWA built on top of your favorite JS framework.
You can read the whole wiki here
- Google Tag Manager account and integration tag
- Nothing else! Just take a small cup of kafe before getting started.
You will need to add the script to your bundle (compiled with Gulp, Webpack, Nwayo, whatever bundler you like) or directly add the script in your html pages.
<script async src="/path/to/swiv/dist/swiv.js"></script><!-- Development -->
<!-- Or -->
<script async src="/path/to/swiv/dist/swiv.min.js"></script><!-- Production -->
You can use it as is, but it is recommended to use a dedicated mapper service for your data model and an implementation module to easily integrate the core module.
Happily, you can use complementary packages provided in the Swiv project (see packages below)