This library contains standard BeHave tracking plugins, it is intended to use the plugins in the customer implementations and not standalone, they require BeHave Tracking Client Library
The library is better known as breakpointmeter, it tracks the scroll depth in combination with BeHave Tracking Client Library
.
const config = {
ARTICLE_SELECTOR: 'article',
}
import { createScrollTracking } from '@strg-behave/tracking-client-plugins'
const scrollTracking = createScrollTracking()
scrollTracking.on('breakpoint', (event) => myTracker.track(event))
const articleElement = [] // Cast to array and pick first found
.concat(config.ARTICLE_SELECTOR)
.map(selector => document.querySelector(selector))
.filter(el => !!el)
.shift()
if (articleElement) {
scrollTracking.scrollDepth(articleElement, {
eventKey: 'breakpoint.content.percent.max',
})
}
This plugin tracks the window.referrer
URL
import { createReferrerTracking } from '@strg-behave/tracking-client-plugins'
const referrerTracking = createReferrerTracking()
referrerTracking.on('referrer', (event) => myTracker.track(event))
This plugin tracks the window.location
URL
import { createUrlTracking } from '@strg-behave/tracking-client-plugins'
const urlTracking = createUrlTracking()
urlTracking.on('url', (event) => myTracker.track(event))
npm install
npm run test
Starts an interactive http server on port 8888
.
npm run coverage
To check the code syntax integrity according to our ESLint specification run:
npm run lint
To autofix code syntax integrity run:
npm run lint:fix
We use SemVer for versioning. For the versions available, see the tags on this repository.
To increase a version and tag in GIT run:
npm version major|minor|patch
- Ralf Traunsteiner - plugin implementations
- Nils Müller - library