@financial-times/n-tracking
Advanced tools
Comparing version 1.0.0-beta.2 to 1.0.0-beta.3
@@ -69,7 +69,7 @@ 'use strict'; | ||
function CoreTracking({ | ||
options | ||
appContext | ||
}) { | ||
// We only need the basics as the full data cannot be assembled | ||
// on the server without the client-side JS. | ||
const context = formatAppContext(options.appContext); | ||
const context = formatAppContext(appContext); | ||
const trackingData = { | ||
@@ -76,0 +76,0 @@ category: 'page', |
@@ -6,3 +6,3 @@ { | ||
"browser": "dist/browser.js", | ||
"version": "1.0.0-beta.2", | ||
"version": "1.0.0-beta.3", | ||
"license": "MIT", | ||
@@ -9,0 +9,0 @@ "repository": "Financial-Times/n-tracking.git", |
# @financial-times/n-tracking [![CircleCI](https://circleci.com/gh/Financial-Times/n-tracking/tree/master.svg?style=svg)](https://circleci.com/gh/Financial-Times/n-tracking/tree/master) | ||
This package provides client-side tracking initialisation for FT.com. On the client-side it configures [o-tracking] (which is used to capture and send tracking events to [Spoor]) and can be used on the server-side to embed fallback tracking pixels. | ||
This package provides tracking initialisation for FT.com. On the client-side it configures [o-tracking] (which is used to capture and send tracking events to [Spoor]) and for the server-side it provides components which render fallback tracking pixels . | ||
@@ -24,5 +24,10 @@ [o-tracking]: https://github.com/Financial-Times/o-tracking | ||
```js | ||
import * as tracking from '@financial-times/n-tracking'; | ||
import * as nTracking from '@financial-times/n-tracking'; | ||
const oTracking = tracking.init(options); | ||
const oTracking = nTracking.init(options); | ||
nTracking.broadcast('oTracking.event', { | ||
category: 'page', | ||
action: 'custom-event', | ||
}); | ||
``` | ||
@@ -40,3 +45,3 @@ | ||
<CoreTracking options={options} /> | ||
<CoreTracking {...options} /> | ||
``` | ||
@@ -64,5 +69,5 @@ | ||
### `<CoreTracking options={} />` | ||
### `<CoreTracking />` | ||
Renders a `<noscript>` and inline `<script>` element to embed fallback tracking pixels into the page which are used when the client-side JS fails to run. It accepts the same [options](#options) as the client-side code. | ||
Renders a `<noscript>` and inline `<script>` element to embed fallback tracking pixels into the page which can be used when the client-side JS fails to run. It accepts the same [options](#options) as the client-side code. | ||
@@ -69,0 +74,0 @@ |
@@ -8,6 +8,6 @@ import React from 'react'; | ||
export function CoreTracking({ options }) { | ||
export function CoreTracking({ appContext }) { | ||
// We only need the basics as the full data cannot be assembled | ||
// on the server without the client-side JS. | ||
const context = formatAppContext(options.appContext); | ||
const context = formatAppContext(appContext); | ||
@@ -14,0 +14,0 @@ const trackingData = { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
570806
88