File tree Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 1+ 2.4.1 / 2017-08-23
2+ ==================
3+
4+ * Fix typeerror for traits.gender.
5+
162.4.0 / 2017-06-08
27==================
38
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ FacebookPixel.prototype.track = function(track) {
128128 acc [ key ] = val ;
129129 return acc ;
130130 } , { } , track . properties ( ) ) ;
131-
131+
132132 var standard = this . standardEvents ( event ) ;
133133 var legacy = this . legacyEvents ( event ) ;
134134
@@ -299,7 +299,10 @@ function formatTraits(analytics) {
299299 firstName = nameArray . shift ( ) ;
300300 lastName = nameArray . pop ( ) ;
301301 }
302- var gender = traits . gender && traits . gender . slice ( 0 , 1 ) . toLowerCase ( ) ;
302+ var gender ;
303+ if ( traits . gender && is . string ( traits . gender ) ) {
304+ gender = traits . gender . slice ( 0 , 1 ) . toLowerCase ( ) ;
305+ }
303306 var birthday = traits . birthday && dateformat ( traits . birthday , 'yyyymmdd' ) ;
304307 var address = traits . address || { } ;
305308 var city = address . city && address . city . split ( ' ' ) . join ( '' ) . toLowerCase ( ) ;
@@ -316,4 +319,4 @@ function formatTraits(analytics) {
316319 st : state ,
317320 zp : postalCode
318321 } ) ;
319- }
322+ }
Original file line number Diff line number Diff line change 11{
22 "name" : " @segment/analytics.js-integration-facebook-pixel" ,
33 "description" : " The Facebook Pixel analytics.js integration." ,
4- "version" : " 2.4.0 " ,
4+ "version" : " 2.4.1 " ,
55 "keywords" : [
66 " analytics.js" ,
77 " analytics.js-integration" ,
Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ describe('Facebook Pixel', function() {
220220 property : true
221221 } ) ;
222222 } ) ;
223-
223+
224224 describe ( 'Dyanmic Ads for Travel date parsing' , function ( ) {
225225 it ( 'should correctly pass in iso8601 formatted date objects' , function ( ) {
226226 analytics . track ( 'search' , {
You can’t perform that action at this time.
0 commit comments