
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
marketing.js
Advanced tools
A flexible marketingchannel recognition and attribution library for the browser
A highly flexible marketingchannel recognition and attribution library. Records a visitor's touchpoints, provides access to the touchpoint history and offers attribution models to operate on the recorded data.
First we create a simple AttributionModel
instance to be used by the engine. This is used to decide which channel(s) will get attributed to what amount. For our testcase we use the pretty common "Last Touch Model", which attributes the last touchpoint within a conversion journey.
const model = new LastTouchAttributionModel();
Then we create the engine and pass our model and the marketing channel configuration.
const engine = new AttributionEngine.init(model, [
new SearchEngineChannel('seo', 'SEO'),
new URLMatchingChannel('sea', 'SEA (Adwords)', 'adword', 'adword'),
]);
Now we are set up to get the touchpoint for the current page impression. This looks at URL, query string and referrer - depending on the types of channels in the configuration. It also adds the recognized Touchpoint
to the internal list with the touchpoint history.
const currentTouchpoint = engine.execute();
console.log(currentTouchpoint.getChannel().getId());
Finally, we can query the attributed Touchpoint
(s) for the visitor based on our AttributionModel
(looks at the last 30 days). Note that this method returns an array of AttributionItem
objects because we need to provide a touchpoint and its associate weight
on the attribution. Also we need any array here, as some attribution models may attribute multiple channels (e.g. "linear" or "time decay" models).
const attributionItems = engine.getAttributionItems();
if (attributionItems.length > 0) {
console.log(attributionItems[0].getTouchpoint().getChannel().getLabel())
}
Check the code for inline JSDOC comments
FAQs
A flexible marketingchannel recognition and attribution library for the browser
The npm package marketing.js receives a total of 0 weekly downloads. As such, marketing.js popularity was classified as not popular.
We found that marketing.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.