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

feat(tracking): track segmentID if cookie is present #358

Merged
merged 1 commit into from Aug 22, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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