Skip to content

Commit

Permalink
Merge pull request #24 from Financial-Times/matth/core-tracking-props…
Browse files Browse the repository at this point in the history
…-rename

Refactor <CoreTracking /> component to accept individual options as props
  • Loading branch information
i-like-robots authored Aug 28, 2019
2 parents a8c6683 + ee8f1c0 commit 7b1e540
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ On the server-side a JSX component embeds tracking pixels into the page which se
```jsx
const { CoreTracking } = require('@financial-times/n-tracking');

<CoreTracking options={options} />
<CoreTracking {...options} />
```

To initialise the component you'll need to provide it with several [configuration options](#options).
Expand All @@ -64,7 +64,7 @@ TODO: custom tracking events to be used across FT.com

## Server-side API

### `<CoreTracking options={} />`
### `<CoreTracking />`

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.

Expand Down
4 changes: 2 additions & 2 deletions src/server/components/CoreTracking.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ const pixel = 'https://spoor-api.ft.com/px.gif?data=';

const placeholder = '[SOURCE]';

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);

const trackingData = {
category: 'page',
Expand Down

0 comments on commit 7b1e540

Please sign in to comment.