
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@aller/blink
Advanced tools
Library for user behaviour tracking.
The main goal is to make tracking of user behavior in news sites easy.
This can be tracking of elements like article previews and ads.
Tracking of general user activity.
This is an idea of how we would like this library to be used.
import blink from '@aller/blink';
blink.configure({
sendUrl: 'https://aas.medialaben.no/a',
sendInterval: 20000,
batchLimit: 3,
batchedSendInterval: 5000,
});
// Track active time
blink.trackActiveTime({
url: document.head.querySelector('meta[property="og:url"]'), // default: window.location.href
});
// Track page load
blink.trackPageLoad({
url: window.location.href,
});
// Track article clicks
blink.trackArticlePreviewClick({
selector: 'article.preview,.article-list>li',
// The url is parsed from the dom
});
// Track article impressions
blink.trackArticlePreviewImpression({
selector: 'article.preview,.article-list>li',
// The url is parsed from the dom
});
blink.trackAdImpressions({
selector: '.adunit',
selector0: '.adunit',
});
// Inside a root config file
import { BlinkProvider } from '@aller/blink';
return (
<BlinkProvider
prodUrl="https://aas.medialaben.no/a"
devUrl="http://localhost:3000/a"
sendInterval={20000}
batchLimit={3}
batchedSendInterval={5000}
trackActivity={false}
trackPageload={true}
>
<App />
</BlinkProvider>
);
// Inside a React component
import { BlinkTracker } from '@aller/blink';
return (
<BlinkTracker>
({trackClick}) =>
<Article onClick={() => trackClick({ id: article.id, url: article.url })} />
</BlinkTracker>
);
No function calls are needed, because the impression is on the container element
import { BlinkTrackerImpression } from '@aller/blink';
return (
<BlinkTrackerImpression url={article.url} threshold={0.5}>
<Article id={article.id} url={article.url} />
</BlinkTrackerImpression>
);
FAQs
A library for tracking user behaviour.
The npm package @aller/blink receives a total of 470 weekly downloads. As such, @aller/blink popularity was classified as not popular.
We found that @aller/blink demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.