99 ADS_FIRST_PARTY_SETTLEMENT_EVENT ,
1010 ADS_FIRST_PARTY_VIEW_ACK_EVENT ,
1111 ADS_EXTERNAL_CONVERSION_CLICK_ID_SHAPES ,
12+ ADS_EXTERNAL_CONVERSION_SELECTED_RAILS ,
1213 ADS_EXTERNAL_CONVERSION_POSTBACK_EVENT ,
1314 ADS_CAMPAIGN_INGRESS_EVIDENCE_EVENT ,
1415 ADS_ADVERTISER_REPORTING_READ_EVENT ,
@@ -1078,11 +1079,15 @@ describe('getAxiomOnlyLogEvent', () => {
10781079 )
10791080 } )
10801081
1081- test ( 'keeps external conversion postbacks content- and identifier -free' , ( ) => {
1082+ test ( 'keeps only advertiser correlation and content -free dimensions on conversion postbacks ' , ( ) => {
10821083 expect (
10831084 getAxiomOnlyLogEvent ( {
10841085 axiomEvent : ADS_EXTERNAL_CONVERSION_POSTBACK_EVENT ,
1085- channel : 'client' ,
1086+ channel : 's2s' ,
1087+ selected_rail : 'identity_email' ,
1088+ email_present : false ,
1089+ email_hash_present : true ,
1090+ email_hash_valid : true ,
10861091 outcome : 'accepted' ,
10871092 rejection_reason : 'none' ,
10881093 event_type : 'signup_completed' ,
@@ -1099,14 +1104,21 @@ describe('getAxiomOnlyLogEvent', () => {
10991104 advertiser_id : 'advertiser-private' ,
11001105 user_id : 'user-private' ,
11011106 email : 'private@example.com' ,
1107+ em : 'a' . repeat ( 64 ) ,
1108+ userData : { em : 'a' . repeat ( 64 ) } ,
11021109 url : 'https://partner.example/private' ,
11031110 body : { private : true } ,
11041111 error : new Error ( 'private failure' ) ,
11051112 } ) ,
11061113 ) . toEqual ( {
11071114 event : ADS_EXTERNAL_CONVERSION_POSTBACK_EVENT ,
11081115 data : {
1109- channel : 'client' ,
1116+ channel : 's2s' ,
1117+ advertiser_id : 'advertiser-private' ,
1118+ selected_rail : 'identity_email' ,
1119+ email_present : false ,
1120+ email_hash_present : true ,
1121+ email_hash_valid : true ,
11101122 outcome : 'accepted' ,
11111123 rejection_reason : 'none' ,
11121124 event_type : 'signup_completed' ,
@@ -1144,13 +1156,44 @@ describe('getAxiomOnlyLogEvent', () => {
11441156 const result = getAxiomOnlyLogEvent ( {
11451157 ...base ,
11461158 click_id_shape : 'bfc_1.private-raw-click-value' ,
1147- advertiser_id : 'advertiser-private ' ,
1159+ advertiser_id : 'advertiser-1 ' ,
11481160 api_key : 'fbadv_private' ,
11491161 } )
11501162 expect ( result ?. data ) . not . toHaveProperty ( 'click_id_shape' )
11511163 expect ( JSON . stringify ( result ) ) . not . toContain ( 'private' )
11521164 } )
11531165
1166+ test ( 'accepts only closed selected rails and boolean identity presence flags' , ( ) => {
1167+ const base = { axiomEvent : ADS_EXTERNAL_CONVERSION_POSTBACK_EVENT }
1168+ for ( const selectedRail of ADS_EXTERNAL_CONVERSION_SELECTED_RAILS ) {
1169+ expect (
1170+ getAxiomOnlyLogEvent ( {
1171+ ...base ,
1172+ selected_rail : selectedRail ,
1173+ email_present : true ,
1174+ email_hash_present : false ,
1175+ email_hash_valid : false ,
1176+ } ) ?. data ,
1177+ ) . toEqual ( {
1178+ selected_rail : selectedRail ,
1179+ email_present : true ,
1180+ email_hash_present : false ,
1181+ email_hash_valid : false ,
1182+ } )
1183+ }
1184+ for ( const invalid of [ 'private@example.com' , 'a' . repeat ( 64 ) , 42 , null ] ) {
1185+ const result = getAxiomOnlyLogEvent ( {
1186+ ...base ,
1187+ selected_rail : invalid ,
1188+ email_present : invalid ,
1189+ email_hash_present : invalid ,
1190+ email_hash_valid : invalid ,
1191+ advertiser_id : { raw : 'private-id' } ,
1192+ } )
1193+ expect ( result ?. data ) . toEqual ( { } )
1194+ }
1195+ } )
1196+
11541197 test ( 'drops a non-string channel from the postback census' , ( ) => {
11551198 const result = getAxiomOnlyLogEvent ( {
11561199 axiomEvent : ADS_EXTERNAL_CONVERSION_POSTBACK_EVENT ,
0 commit comments