Skip to content

Commit

Permalink
Update default standard parameters
Browse files Browse the repository at this point in the history
Summary: Remove fb_search_string, fb_status, fb_content_name, fb_content_category from default standard parameters

Reviewed By: seanmksha

Differential Revision: D60362112

fbshipit-source-id: 05b3f101a6a8bf422805e95e545b624b488841d8
  • Loading branch information
Zilin Zhang authored and facebook-github-bot committed Jul 29, 2024
1 parent e905cac commit 9bc0671
Show file tree
Hide file tree
Showing 2 changed files with 144 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Foundation
public final class ProtectedModeManager: NSObject, _AppEventsParameterProcessing {
private var isEnabled = false
private static let pmKey = AppEvents.ParameterName(rawValue: "pm")
private let standardParametersDefault: Set<String> = [
let standardParametersDefault: Set<String> = [
"_currency",
"_valueToSum",
"fb_availability",
Expand All @@ -21,9 +21,7 @@ public final class ProtectedModeManager: NSObject, _AppEventsParameterProcessing
"fb_checkout_date",
"fb_city",
"fb_condition_of_vehicle",
"fb_content_category",
"fb_content_ids",
"fb_content_name",
"fb_content_type",
"fb_contents",
"fb_country",
Expand Down Expand Up @@ -66,9 +64,7 @@ public final class ProtectedModeManager: NSObject, _AppEventsParameterProcessing
"fb_region",
"fb_returning_arrival_date",
"fb_returning_departure_date",
"fb_search_string",
"fb_state_of_vehicle",
"fb_status",
"fb_suggested_destinations",
"fb_suggested_home_listings",
"fb_suggested_hotels",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,149 @@ final class ProtectedModeManagerTests: XCTestCase {
AppEvents.ParameterName.implicitlyLogged: true,
]

func testDefaultParameters() {
let expectedDParameters: Set<String> = [
"_currency",
"_valueToSum",
"fb_availability",
"fb_body_style",
"fb_checkin_date",
"fb_checkout_date",
"fb_city",
"fb_condition_of_vehicle",
"fb_content_ids",
"fb_content_type",
"fb_contents",
"fb_country",
"fb_currency",
"fb_delivery_category",
"fb_departing_arrival_date",
"fb_departing_departure_date",
"fb_destination_airport",
"fb_destination_ids",
"fb_dma_code",
"fb_drivetrain",
"fb_exterior_color",
"fb_fuel_type",
"fb_hotel_score",
"fb_interior_color",
"fb_lease_end_date",
"fb_lease_start_date",
"fb_listing_type",
"fb_make",
"fb_mileage.unit",
"fb_mileage.value",
"fb_model",
"fb_neighborhood",
"fb_num_adults",
"fb_num_children",
"fb_num_infants",
"fb_num_items",
"fb_order_id",
"fb_origin_airport",
"fb_postal_code",
"fb_predicted_ltv",
"fb_preferred_baths_range",
"fb_preferred_beds_range",
"fb_preferred_neighborhoods",
"fb_preferred_num_stops",
"fb_preferred_price_range",
"fb_preferred_star_ratings",
"fb_price",
"fb_property_type",
"fb_region",
"fb_returning_arrival_date",
"fb_returning_departure_date",
"fb_state_of_vehicle",
"fb_suggested_destinations",
"fb_suggested_home_listings",
"fb_suggested_hotels",
"fb_suggested_jobs",
"fb_suggested_local_service_businesses",
"fb_suggested_location_based_items",
"fb_suggested_vehicles",
"fb_transmission",
"fb_travel_class",
"fb_travel_end",
"fb_travel_start",
"fb_trim",
"fb_user_bucket",
"fb_value",
"fb_vin",
"fb_year",
"lead_event_source",
"predicted_ltv",
"product_catalog_id",
"app_user_id",
"appVersion",
"_eventName",
"_eventName_md5",
"_currency",
"_implicitlyLogged",
"_inBackground",
"_isTimedEvent",
"_logTime",
"fb_order_id",
"_session_id",
"_ui",
"_valueToSum",
"_valueToUpdate",
"_is_fb_codeless",
"_is_suggested_event",
"_fb_pixel_referral_id",
"fb_pixel_id",
"trace_id",
"user_agent",
"subscription_id",
"predicted_ltv",
"event_id",
"_restrictedParams",
"_onDeviceParams",
"purchase_valid_result_type",
"core_lib_included",
"login_lib_included",
"share_lib_included",
"place_lib_included",
"messenger_lib_included",
"applinks_lib_included",
"marketing_lib_included",
"_codeless_action",
"sdk_initialized",
"billing_client_lib_included",
"billing_service_lib_included",
"user_data_keys",
"device_push_token",
"fb_mobile_pckg_fp",
"fb_mobile_app_cert_hash",
"aggregate_id",
"anonymous_id",
"campaign_ids",
"fb_post_attachment",
"receipt_data",
"ad_type",
"fb_content",
"fb_content_id",
"fb_content_type",
"fb_currency",
"fb_description",
"fb_level",
"fb_max_rating_value",
"fb_num_items",
"fb_order_id",
"fb_payment_info_available",
"fb_registration_method",
"fb_search_string",
"fb_success",
"pm",
"_audiencePropertyIds",
"cs_maca",
]
XCTAssertEqual(
protectedModeManager.standardParametersDefault,
expectedDParameters
)
}

func testProcessParametersWithoutEnable() {
XCTAssertEqual(
protectedModeManager.processParameters(sampleParameters, eventName: AppEvents.Name.addedToCart)?.count,
Expand Down

0 comments on commit 9bc0671

Please sign in to comment.