Library for user behaviour tracking.
The main goal is to make it easy to track user behavior on our sites.
- easy to configure
- small bundle size
- only collects and stores what is necessary
- ability to track multiple pages at the same time
We have several types of trackers:
- Pageload tracking
- Active time tracking
- Impression tracking
- Ad tracking
- Click tracking
- Video tracking
In addition, we expose one custom tracker type to fill miscellaneous needs.
;const blink =;// Initialize a new "page",// flushes state, and creates a new uuid for the pageViewblink;// Track a when the page loadsblink;// Track page performance timingsblink// Track that the user clicked on an element / articleblink;/*** AD-RELATED FUNCTIONS*/// Track that an ad entered the screen by 30% og 50%, depending on the ad sizeblink;// Track that an ad left the screen, by having less than 30% or 50% inside viewblink;// Track that an ad entered the screen by the first pixelblink;// Track that an ad is completely out of the screenblink;// Track that an ad started loadingblink;// Track data that is gotten from DFP, with internals only known by DFP gurusblink;blink;blink;/*** ARTICLE-RELATED FUNCTIONS*/// Track that an article preview went into screenblink;// Tracking of the users total activity time on a given articleblink; // sets the user as active for the next 10 seconds, unless a stop event is sentblink; // sets the user as inactive, and sends active time data
Should be called on a page initialization. Sets the pageView and computes values that will not change over the course of the page view.
clickinput: ClickInput: void;
adScreenEnter;adScreenExit;adScreenEnter0;adScreenExit0;adLoad;// DFP EventsdfpImpressionViewable;dfpSlotRenderEnded;dfpSlotOnload;
; // sets the user as active for the next 10 seconds, unless a stop event is sent; // sets the user as inactive, and sends active time data
Explicitly tell blink to send all events. A common usecase is to send all events before a page is unloading.
Box tracking is for tracking elements on ap age that not neccesarily are article previews, but more general boxes.