Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions integrations/adobe-analytics/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,14 @@ function updateContextData(facade, options) {
return;
}

// If context data values are booleans then stringify them.
// Adobe's SDK seems to reject a false boolean value. Stringifying is
// acceptable since these values are appended as query strings anyway.
if (typeof value === 'boolean') {
addContextDatum(key, value.toString());
return;
}

addContextDatum(key, value);
}, contextProperties);
}
Expand Down
24 changes: 24 additions & 0 deletions integrations/adobe-analytics/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,30 @@ describe('Adobe Analytics', function() {
});
analytics.equal(window.s.events, 'prodView,event1,event38');
});

it('should stringify bool context data', function() {
adobeAnalytics.options.contextValues = {
'page.referrer': 'page.referrer',
'page.url': 'page.title',
'page.bickenBack': 'page.bickenBack'
};
analytics.track(
'Drank Some Milk',
{ foo: 'bar' },
{ page: { bickenBack: false } }
);
analytics.equal(
window.s.contextData['page.referrer'],
window.document.referrer
);
analytics.equal(
window.s.contextData['page.title'],
window.location.href
);
analytics.equal(window.s.contextData['page.bickenBack'], 'false');
analytics.equal(window.s.contextData.foo, 'bar');
analytics.called(window.s.tl);
});
});
});

Expand Down