File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
integrations/adobe-analytics Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -620,6 +620,14 @@ function updateContextData(facade, options) {
620620 return ;
621621 }
622622
623+ // If context data values are booleans then stringify them.
624+ // Adobe's SDK seems to reject a false boolean value. Stringifying is
625+ // acceptable since these values are appended as query strings anyway.
626+ if ( typeof value === 'boolean' ) {
627+ addContextDatum ( key , value . toString ( ) ) ;
628+ return ;
629+ }
630+
623631 addContextDatum ( key , value ) ;
624632 } , contextProperties ) ;
625633}
Original file line number Diff line number Diff line change @@ -1175,6 +1175,30 @@ describe('Adobe Analytics', function() {
11751175 } ) ;
11761176 analytics . equal ( window . s . events , 'prodView,event1,event38' ) ;
11771177 } ) ;
1178+
1179+ it ( 'should stringify bool context data' , function ( ) {
1180+ adobeAnalytics . options . contextValues = {
1181+ 'page.referrer' : 'page.referrer' ,
1182+ 'page.url' : 'page.title' ,
1183+ 'page.bickenBack' : 'page.bickenBack'
1184+ } ;
1185+ analytics . track (
1186+ 'Drank Some Milk' ,
1187+ { foo : 'bar' } ,
1188+ { page : { bickenBack : false } }
1189+ ) ;
1190+ analytics . equal (
1191+ window . s . contextData [ 'page.referrer' ] ,
1192+ window . document . referrer
1193+ ) ;
1194+ analytics . equal (
1195+ window . s . contextData [ 'page.title' ] ,
1196+ window . location . href
1197+ ) ;
1198+ analytics . equal ( window . s . contextData [ 'page.bickenBack' ] , 'false' ) ;
1199+ analytics . equal ( window . s . contextData . foo , 'bar' ) ;
1200+ analytics . called ( window . s . tl ) ;
1201+ } ) ;
11781202 } ) ;
11791203 } ) ;
11801204
You can’t perform that action at this time.
0 commit comments