Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
Merge pull request #358 from Financial-Times/track-segment-id
Browse files Browse the repository at this point in the history
feat(tracking): track segmentID if cookie is present
  • Loading branch information
keithamus committed Aug 22, 2016
2 parents e6f8bb1 + 662e30f commit f57ccc8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tracking/ft/index.js
Expand Up @@ -64,6 +64,10 @@ const oTrackingWrapper = {

const edition = document.querySelector('[data-next-edition]') ? document.querySelector('[data-next-edition]').getAttribute('data-next-edition') : null;
context.edition = edition;
const segmentID = String(document.cookie).match(/(?:^|;)\s*segmentID=([^;]+)/) || [];
if (segmentID[1]) {
context.segmentID = segmentID[1];
}

oTracking.init({
server: 'https://spoor-api.ft.com/ingest',
Expand Down

0 comments on commit f57ccc8

Please sign in to comment.