Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@financial-times/n-tracking

Package Overview
Dependencies
Maintainers
9
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@financial-times/n-tracking - npm Package Compare versions

Comparing version 5.1.0 to 5.2.0

8

dist/browser.js

@@ -335,3 +335,3 @@ import oTracking from '@financial-times/o-tracking';

const samplePercentage = 10;
const defaultSampleRate = 10;

@@ -342,3 +342,3 @@ const isContextComplete = (context) => {

const realUserMonitoringForPerformance = () => {
const realUserMonitoringForPerformance = ({ sampleRate } = {}) => {

@@ -351,4 +351,6 @@ // Check browser support.

sampleRate = Number.isFinite(sampleRate) && sampleRate <= 100 && sampleRate >= 0 ? sampleRate : defaultSampleRate;
// Gather metrics for only a cohort of users.
if (!seedIsInSample(spoorId, samplePercentage)) return;
if (!seedIsInSample(spoorId, sampleRate)) return;

@@ -355,0 +357,0 @@ // Proceed only if the page load event is a "navigate".

@@ -6,3 +6,3 @@ {

"browser": "dist/browser.js",
"version": "5.1.0",
"version": "5.2.0",
"license": "MIT",

@@ -9,0 +9,0 @@ "repository": "Financial-Times/n-tracking.git",

@@ -20,3 +20,3 @@ import Perfume from 'perfume.js';

const samplePercentage = 10;
const defaultSampleRate = 10;

@@ -27,3 +27,3 @@ const isContextComplete = (context) => {

export const realUserMonitoringForPerformance = () => {
export const realUserMonitoringForPerformance = ({ sampleRate } = {}) => {

@@ -36,4 +36,6 @@ // Check browser support.

sampleRate = Number.isFinite(sampleRate) && sampleRate <= 100 && sampleRate >= 0 ? sampleRate : defaultSampleRate;
// Gather metrics for only a cohort of users.
if (!seedIsInSample(spoorId, samplePercentage)) return;
if (!seedIsInSample(spoorId, sampleRate)) return;

@@ -40,0 +42,0 @@ // Proceed only if the page load event is a "navigate".

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc