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
16
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@financial-times/n-tracking

Client-side tracking initialisation for FT.com apps

  • 1.0.0-beta.1
  • npm
  • Socket score

Version published
Weekly downloads
480
increased by168.16%
Maintainers
16
Weekly downloads
 
Created
Source

@financial-times/n-tracking CircleCI

This package provides client-side tracking initialisation for FT.com. It configures o-tracking (which is used to capture and send tracking events to Spoor) with the provided and automatically inferred context data.

Getting started

This package is for client-side use and is distributed on npm.

npm install -S @financial-times/n-tracking

After installing the package you can import the tracking component into your client-side code:

import * as tracking from '@financial-times/n-tracking';

const oTracking = tracking.init(options);

To initialise the component you'll need to provide it with several configuration options.

API

init(options)

Configures o-tracking with the given options, triggers a page view event, initialises click tracking, and returns the instance of o-tracking.

broadcast(name, data)

Creates a CustomEvent with the given name and data and dispatches it from the document <body> element. It is intended to be used to trigger oTracking.event events.

trackers.customTrackerName()

TODO: custom tracking events to be used across FT.com

Options

PropertyTypeRequiredDescription
appContextObjectYesFT.com App Context data describing the current page which will be appended to all captured events.
extraContextObjectNoAdditional data describing the current page which will be appended to all captured events.
pageViewContextObjectNoAdditional data to append to the page view event but not

Automatically inferred data

  • Marketing query string parameters inc. cost-per-click and segment IDs
  • User data inc. layout, screen orientation, and connection type
  • Error page parameters inc. error code and error message

FAQs

Package last updated on 29 Jul 2019

Did you know?

Socket

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.

Install

Related posts

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