facebookbusiness 20.0.0 → 20.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/facebook_ads/ad_objects/ad_account.rb +29 -1
- data/lib/facebook_ads/ad_objects/ad_account_ad_volume.rb +57 -0
- data/lib/facebook_ads/ad_objects/{ad_account_optimization_goals_ae_mv2_eligibility.rb → ad_account_optimization_goals_aemv2_eligibility.rb} +1 -1
- data/lib/facebook_ads/ad_objects/ad_account_recommendations.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_account_targeting_unified.rb +2 -0
- data/lib/facebook_ads/ad_objects/ad_account_user_settings.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_asset_feed_spec.rb +2 -0
- data/lib/facebook_ads/ad_objects/{product_catalog_microdata_stats_pixel_info.rb → ad_campaign_conversion_value_expression_spec.rb} +4 -3
- data/lib/facebook_ads/ad_objects/ad_creative.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_creative_branded_content_ads.rb +2 -0
- data/lib/facebook_ads/ad_objects/{product_catalog_example_feed.rb → ad_creative_destination_spec.rb} +2 -2
- data/lib/facebook_ads/ad_objects/ad_creative_feature_customizations.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_creative_features_spec.rb +3 -0
- data/lib/facebook_ads/ad_objects/ad_creative_link_data.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_creative_link_data_call_to_action.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_creative_link_data_call_to_action_value.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_creative_link_data_image_layer_spec.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_creative_link_data_moment.rb +0 -1
- data/lib/facebook_ads/ad_objects/ad_creative_marketing_message_structured_spec.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_creative_object_story_spec.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_creative_site_links_spec.rb +3 -0
- data/lib/facebook_ads/ad_objects/ad_creative_sourcing_spec.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_promoted_object.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_rule_execution_spec.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_set.rb +15 -0
- data/lib/facebook_ads/ad_objects/ad_video.rb +2 -6
- data/lib/facebook_ads/ad_objects/adjacent_content_delivery_report.rb +2 -0
- data/lib/facebook_ads/ad_objects/ads_insights.rb +5 -1
- data/lib/facebook_ads/ad_objects/ads_pixel.rb +1 -0
- data/lib/facebook_ads/ad_objects/ads_user_settings.rb +3 -1
- data/lib/facebook_ads/ad_objects/alm_ad_account_info.rb +30 -0
- data/lib/facebook_ads/ad_objects/alm_end_advertiser_info.rb +27 -0
- data/lib/facebook_ads/ad_objects/alm_event.rb +34 -0
- data/lib/facebook_ads/ad_objects/alm_guidance.rb +28 -0
- data/lib/facebook_ads/ad_objects/alm_guidance_metrics.rb +37 -0
- data/lib/facebook_ads/ad_objects/application.rb +1 -0
- data/lib/facebook_ads/ad_objects/automotive_model.rb +7 -4
- data/lib/facebook_ads/ad_objects/{page_videos_you_can_use.rb → brand_safety_campaign_config.rb} +3 -4
- data/lib/facebook_ads/ad_objects/business.rb +21 -1
- data/lib/facebook_ads/ad_objects/business_role_request.rb +1 -0
- data/lib/facebook_ads/ad_objects/business_user.rb +6 -0
- data/lib/facebook_ads/ad_objects/campaign.rb +1 -0
- data/lib/facebook_ads/ad_objects/catalog_item_rejection_reasons.rb +1 -0
- data/lib/facebook_ads/ad_objects/catalog_smart_pixel_settings.rb +0 -3
- data/lib/facebook_ads/ad_objects/commerce_order.rb +1 -0
- data/lib/facebook_ads/ad_objects/commerce_order_transaction_detail.rb +5 -0
- data/lib/facebook_ads/ad_objects/{cpas_setup_catalog_progress.rb → content_block_list.rb} +14 -5
- data/lib/facebook_ads/ad_objects/ctwa_whats_app_numbers_info.rb +1 -0
- data/lib/facebook_ads/ad_objects/ctx_partner_app_welcome_message_flow.rb +2 -0
- data/lib/facebook_ads/ad_objects/{vidwalla_broadcast.rb → dataset.rb} +3 -2
- data/lib/facebook_ads/ad_objects/destination.rb +7 -4
- data/lib/facebook_ads/ad_objects/flight.rb +7 -4
- data/lib/facebook_ads/ad_objects/funding_source_details_coupon.rb +3 -0
- data/lib/facebook_ads/ad_objects/group.rb +0 -2
- data/lib/facebook_ads/ad_objects/home_listing.rb +7 -4
- data/lib/facebook_ads/ad_objects/hotel.rb +7 -4
- data/lib/facebook_ads/ad_objects/ig_media.rb +5 -4
- data/lib/facebook_ads/ad_objects/ig_media_for_ig_only_api.rb +9 -1
- data/lib/facebook_ads/ad_objects/ig_refresh_access_token_for_ig_only_api.rb +1 -0
- data/lib/facebook_ads/ad_objects/ig_upcoming_event.rb +23 -0
- data/lib/facebook_ads/ad_objects/ig_user.rb +5 -2
- data/lib/facebook_ads/ad_objects/{bcp_creator_ig_user.rb → ig_user_export_for_cam.rb} +1 -1
- data/lib/facebook_ads/ad_objects/ig_user_for_ig_only_api.rb +101 -0
- data/lib/facebook_ads/ad_objects/insights_result.rb +7 -190
- data/lib/facebook_ads/ad_objects/instagram_insights_result.rb +5 -0
- data/lib/facebook_ads/ad_objects/instagram_user.rb +2 -0
- data/lib/facebook_ads/ad_objects/lead_gen_form_preview_details.rb +4 -0
- data/lib/facebook_ads/ad_objects/local_service_business.rb +7 -0
- data/lib/facebook_ads/ad_objects/media_title.rb +7 -4
- data/lib/facebook_ads/ad_objects/message_delivery_estimate.rb +73 -0
- data/lib/facebook_ads/ad_objects/messaging_apps_info.rb +1 -0
- data/lib/facebook_ads/ad_objects/offline_product_item.rb +7 -0
- data/lib/facebook_ads/ad_objects/{instant_article_cta.rb → override_details.rb} +10 -5
- data/lib/facebook_ads/ad_objects/{p2_m_invoice_payments.rb → p2m_invoice_payments.rb} +1 -1
- data/lib/facebook_ads/ad_objects/page.rb +9 -13
- data/lib/facebook_ads/ad_objects/page_ctx_messaging_feature_limit.rb +27 -0
- data/lib/facebook_ads/ad_objects/product_catalog.rb +6 -2
- data/lib/facebook_ads/ad_objects/{user_set_reporting_root.rb → product_delivery_preference.rb} +4 -3
- data/lib/facebook_ads/ad_objects/product_group.rb +5 -0
- data/lib/facebook_ads/ad_objects/product_item.rb +18 -1
- data/lib/facebook_ads/ad_objects/reseller_guidance.rb +0 -3
- data/lib/facebook_ads/ad_objects/server_side/attribution_data.rb +216 -0
- data/lib/facebook_ads/ad_objects/server_side/event.rb +44 -4
- data/lib/facebook_ads/ad_objects/server_side/event_request.rb +1 -0
- data/lib/facebook_ads/ad_objects/server_side/original_event_data.rb +107 -0
- data/lib/facebook_ads/ad_objects/server_side/util.rb +1 -1
- data/lib/facebook_ads/ad_objects/{product_feed_missing_feed_item_replacement.rb → shadow_ig_user_partnership_ads_media_errors.rb} +5 -4
- data/lib/facebook_ads/ad_objects/stories.rb +7 -2
- data/lib/facebook_ads/ad_objects/third_party_partner_viewability_request.rb +14 -2
- data/lib/facebook_ads/ad_objects/transactable_item.rb +7 -0
- data/lib/facebook_ads/ad_objects/user.rb +1 -2
- data/lib/facebook_ads/ad_objects/vehicle.rb +7 -4
- data/lib/facebook_ads/ad_objects/vehicle_offer.rb +7 -4
- data/lib/facebook_ads/ad_objects/whats_app_business_account.rb +69 -1
- data/lib/facebook_ads/ad_objects/whats_app_business_partner_client_verification_submission.rb +2 -0
- data/lib/facebook_ads/ad_objects/{with_asset3_d.rb → with_asset_3d.rb} +1 -1
- data/lib/facebook_ads/version.rb +1 -1
- metadata +25 -22
- data/lib/facebook_ads/ad_objects/adoptable_pet.rb +0 -77
- data/lib/facebook_ads/ad_objects/catalog_item_appeal_status.rb +0 -36
- data/lib/facebook_ads/ad_objects/expirable_post.rb +0 -43
- data/lib/facebook_ads/ad_objects/generic_video_asset.rb +0 -69
- data/lib/facebook_ads/ad_objects/location_based_item.rb +0 -53
- data/lib/facebook_ads/ad_objects/video_asset.rb +0 -75
@@ -235,6 +235,7 @@ module FacebookAds
|
|
235
235
|
"MESSAGE_TAG",
|
236
236
|
"RESPONSE",
|
237
237
|
"UPDATE",
|
238
|
+
"UTILITY",
|
238
239
|
]
|
239
240
|
|
240
241
|
NOTIFICATION_TYPE = [
|
@@ -298,6 +299,7 @@ module FacebookAds
|
|
298
299
|
"awards",
|
299
300
|
"bio",
|
300
301
|
"birthday",
|
302
|
+
"call_permission_reply",
|
301
303
|
"calls",
|
302
304
|
"category",
|
303
305
|
"checkins",
|
@@ -348,6 +350,7 @@ module FacebookAds
|
|
348
350
|
"messaging_game_plays",
|
349
351
|
"messaging_handovers",
|
350
352
|
"messaging_in_thread_lead_form_submit",
|
353
|
+
"messaging_integrity",
|
351
354
|
"messaging_optins",
|
352
355
|
"messaging_optouts",
|
353
356
|
"messaging_payments",
|
@@ -782,8 +785,10 @@ module FacebookAds
|
|
782
785
|
end
|
783
786
|
|
784
787
|
has_edge :dataset do |edge|
|
785
|
-
edge.get '
|
786
|
-
edge.post '
|
788
|
+
edge.get 'Dataset'
|
789
|
+
edge.post 'Dataset' do |api|
|
790
|
+
api.has_param :dataset_name, 'string'
|
791
|
+
end
|
787
792
|
end
|
788
793
|
|
789
794
|
has_edge :events do |edge|
|
@@ -817,7 +822,6 @@ module FacebookAds
|
|
817
822
|
api.has_param :actions, 'object'
|
818
823
|
api.has_param :album_id, 'string'
|
819
824
|
api.has_param :android_key_hash, 'string'
|
820
|
-
api.has_param :animated_effect_id, 'int'
|
821
825
|
api.has_param :application_id, 'string'
|
822
826
|
api.has_param :asked_fun_fact_prompt_id, 'int'
|
823
827
|
api.has_param :asset3d_id, 'int'
|
@@ -931,13 +935,6 @@ module FacebookAds
|
|
931
935
|
edge.get 'Page'
|
932
936
|
end
|
933
937
|
|
934
|
-
has_edge :groups do |edge|
|
935
|
-
edge.get 'Group' do |api|
|
936
|
-
api.has_param :admin_only, 'bool'
|
937
|
-
api.has_param :parent, 'string'
|
938
|
-
end
|
939
|
-
end
|
940
|
-
|
941
938
|
has_edge :image_copyrights do |edge|
|
942
939
|
edge.get 'ImageCopyright'
|
943
940
|
edge.post 'ImageCopyright' do |api|
|
@@ -1190,7 +1187,7 @@ module FacebookAds
|
|
1190
1187
|
edge.post 'Page' do |api|
|
1191
1188
|
api.has_param :metadata, 'string'
|
1192
1189
|
api.has_param :recipient, 'object'
|
1193
|
-
api.has_param :target_app_id, '
|
1190
|
+
api.has_param :target_app_id, 'string'
|
1194
1191
|
end
|
1195
1192
|
end
|
1196
1193
|
|
@@ -1523,7 +1520,6 @@ module FacebookAds
|
|
1523
1520
|
end
|
1524
1521
|
edge.post 'AdVideo' do |api|
|
1525
1522
|
api.has_param :ad_breaks, { list: 'string' }
|
1526
|
-
api.has_param :animated_effect_id, 'int'
|
1527
1523
|
api.has_param :application_id, 'string'
|
1528
1524
|
api.has_param :asked_fun_fact_prompt_id, 'int'
|
1529
1525
|
api.has_param :audio_story_wave_animation_handle, 'string'
|
@@ -1634,7 +1630,7 @@ module FacebookAds
|
|
1634
1630
|
api.has_param :flow_id, 'string'
|
1635
1631
|
end
|
1636
1632
|
edge.post do |api|
|
1637
|
-
api.has_param :eligible_platforms, { list: { enum: %w{INSTAGRAM MESSENGER }} }
|
1633
|
+
api.has_param :eligible_platforms, { list: { enum: %w{INSTAGRAM MESSENGER WHATSAPP }} }
|
1638
1634
|
api.has_param :flow_id, 'string'
|
1639
1635
|
api.has_param :name, 'string'
|
1640
1636
|
api.has_param :welcome_message_flow, { list: 'object' }
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
2
|
+
# All rights reserved.
|
3
|
+
|
4
|
+
# This source code is licensed under the license found in the
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
6
|
+
|
7
|
+
# FB:AUTOGEN
|
8
|
+
|
9
|
+
module FacebookAds
|
10
|
+
# This class is auto-generated.
|
11
|
+
|
12
|
+
# For any issues or feature requests related to this class, please let us know
|
13
|
+
# on github and we'll fix in our codegen framework. We'll not be able to accept
|
14
|
+
# pull request for this class.
|
15
|
+
|
16
|
+
class PageCtxMessagingFeatureLimit < AdObject
|
17
|
+
|
18
|
+
field :messaging_feature_limit_duration, 'int'
|
19
|
+
field :messaging_feature_limit_type, 'string'
|
20
|
+
field :messaging_violation_type, 'string'
|
21
|
+
has_no_id
|
22
|
+
has_no_get
|
23
|
+
has_no_post
|
24
|
+
has_no_delete
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
@@ -124,7 +124,7 @@ module FacebookAds
|
|
124
124
|
api.has_param :business, 'string'
|
125
125
|
api.has_param :permitted_roles, { list: { enum: -> { ProductCatalog::PERMITTED_ROLES }} }
|
126
126
|
api.has_param :permitted_tasks, { list: { enum: -> { ProductCatalog::PERMITTED_TASKS }} }
|
127
|
-
api.has_param :
|
127
|
+
api.has_param :skip_defaults, 'bool'
|
128
128
|
api.has_param :utm_settings, 'hash'
|
129
129
|
end
|
130
130
|
end
|
@@ -409,7 +409,6 @@ module FacebookAds
|
|
409
409
|
end
|
410
410
|
edge.post 'ProductItem' do |api|
|
411
411
|
api.has_param :additional_image_urls, { list: 'string' }
|
412
|
-
api.has_param :additional_uploaded_image_ids, { list: 'string' }
|
413
412
|
api.has_param :additional_variant_attributes, 'hash'
|
414
413
|
api.has_param :android_app_name, 'string'
|
415
414
|
api.has_param :android_class, 'string'
|
@@ -464,6 +463,11 @@ module FacebookAds
|
|
464
463
|
api.has_param :origin_country, { enum: -> { ProductItem::ORIGIN_COUNTRY }}
|
465
464
|
api.has_param :pattern, 'string'
|
466
465
|
api.has_param :price, 'int'
|
466
|
+
api.has_param :product_priority_0, 'double'
|
467
|
+
api.has_param :product_priority_1, 'double'
|
468
|
+
api.has_param :product_priority_2, 'double'
|
469
|
+
api.has_param :product_priority_3, 'double'
|
470
|
+
api.has_param :product_priority_4, 'double'
|
467
471
|
api.has_param :product_type, 'string'
|
468
472
|
api.has_param :quantity_to_sell_on_facebook, 'int'
|
469
473
|
api.has_param :retailer_id, 'string'
|
data/lib/facebook_ads/ad_objects/{user_set_reporting_root.rb → product_delivery_preference.rb}
RENAMED
@@ -13,11 +13,12 @@ module FacebookAds
|
|
13
13
|
# on github and we'll fix in our codegen framework. We'll not be able to accept
|
14
14
|
# pull request for this class.
|
15
15
|
|
16
|
-
class
|
16
|
+
class ProductDeliveryPreference < AdObject
|
17
17
|
|
18
|
-
field :
|
18
|
+
field :ad_object_id, 'string'
|
19
19
|
field :id, 'string'
|
20
|
-
field :
|
20
|
+
field :product_priority, 'string'
|
21
|
+
field :product_priority_category, { list: 'string' }
|
21
22
|
has_no_post
|
22
23
|
has_no_delete
|
23
24
|
|
@@ -73,6 +73,11 @@ module FacebookAds
|
|
73
73
|
api.has_param :ordering_index, 'int'
|
74
74
|
api.has_param :pattern, 'string'
|
75
75
|
api.has_param :price, 'int'
|
76
|
+
api.has_param :product_priority_0, 'double'
|
77
|
+
api.has_param :product_priority_1, 'double'
|
78
|
+
api.has_param :product_priority_2, 'double'
|
79
|
+
api.has_param :product_priority_3, 'double'
|
80
|
+
api.has_param :product_priority_4, 'double'
|
76
81
|
api.has_param :product_type, 'string'
|
77
82
|
api.has_param :quantity_to_sell_on_facebook, 'int'
|
78
83
|
api.has_param :retailer_id, 'string'
|
@@ -313,6 +313,7 @@ module FacebookAds
|
|
313
313
|
"BAD_QUALITY_IMAGE",
|
314
314
|
"BIG_CATALOG_WITH_ALL_ITEMS_IN_STOCK",
|
315
315
|
"BIZ_MSG_AI_AGENT_DISABLED_BY_USER",
|
316
|
+
"BIZ_MSG_GEN_AI_POLICY_VIOLATED",
|
316
317
|
"CANNOT_EDIT_SUBSCRIPTION_PRODUCTS",
|
317
318
|
"CATALOG_NOT_CONNECTED_TO_EVENT_SOURCE",
|
318
319
|
"CHECKOUT_DISABLED_BY_USER",
|
@@ -445,6 +446,8 @@ module FacebookAds
|
|
445
446
|
"VIDEO_FETCH_FAILED_TIMED_OUT",
|
446
447
|
"VIDEO_NOT_DOWNLOADABLE",
|
447
448
|
"WHATSAPP_DISABLED_BY_USER",
|
449
|
+
"WHATSAPP_MARKETING_MESSAGE_DISABLED_BY_USER",
|
450
|
+
"WHATSAPP_MARKETING_MESSAGE_POLICY_VIOLATION",
|
448
451
|
"WHATSAPP_POLICY_VIOLATION",
|
449
452
|
]
|
450
453
|
|
@@ -721,6 +724,8 @@ module FacebookAds
|
|
721
724
|
field :applinks, 'CatalogItemAppLinks'
|
722
725
|
field :availability, { enum: -> { AVAILABILITY }}
|
723
726
|
field :brand, 'string'
|
727
|
+
field :bundle_items, { list: 'string' }
|
728
|
+
field :bundle_retailer_ids, { list: 'string' }
|
724
729
|
field :capability_to_review_status, { list: 'hash' }
|
725
730
|
field :category, 'string'
|
726
731
|
field :category_specific_fields, 'CatalogSubVerticalList'
|
@@ -754,6 +759,7 @@ module FacebookAds
|
|
754
759
|
field :importer_name, 'string'
|
755
760
|
field :invalidation_errors, { list: 'ProductItemInvalidationError' }
|
756
761
|
field :inventory, 'int'
|
762
|
+
field :is_bundle_hero, 'bool'
|
757
763
|
field :manufacturer_info, 'string'
|
758
764
|
field :manufacturer_part_number, 'string'
|
759
765
|
field :marked_for_product_launch, 'string'
|
@@ -789,7 +795,6 @@ module FacebookAds
|
|
789
795
|
field :video_fetch_status, { enum: -> { VIDEO_FETCH_STATUS }}
|
790
796
|
field :visibility, { enum: -> { VISIBILITY }}
|
791
797
|
field :wa_compliance_category, 'string'
|
792
|
-
field :additional_uploaded_image_ids, { list: 'string' }
|
793
798
|
field :android_app_name, 'string'
|
794
799
|
field :android_class, 'string'
|
795
800
|
field :android_package, 'string'
|
@@ -806,6 +811,11 @@ module FacebookAds
|
|
806
811
|
field :iphone_app_store_id, 'int'
|
807
812
|
field :iphone_url, 'string'
|
808
813
|
field :launch_date, 'string'
|
814
|
+
field :product_priority_0, 'double'
|
815
|
+
field :product_priority_1, 'double'
|
816
|
+
field :product_priority_2, 'double'
|
817
|
+
field :product_priority_3, 'double'
|
818
|
+
field :product_priority_4, 'double'
|
809
819
|
field :return_policy_days, 'int'
|
810
820
|
field :windows_phone_app_id, 'string'
|
811
821
|
field :windows_phone_app_name, 'string'
|
@@ -815,6 +825,13 @@ module FacebookAds
|
|
815
825
|
edge.get 'CatalogItemChannelsToIntegrityStatus'
|
816
826
|
end
|
817
827
|
|
828
|
+
has_edge :override_details do |edge|
|
829
|
+
edge.get 'OverrideDetails' do |api|
|
830
|
+
api.has_param :keys, { list: 'string' }
|
831
|
+
api.has_param :type, { enum: -> { OverrideDetails::TYPE }}
|
832
|
+
end
|
833
|
+
end
|
834
|
+
|
818
835
|
has_edge :product_sets do |edge|
|
819
836
|
edge.get 'ProductSet'
|
820
837
|
end
|
@@ -21,10 +21,7 @@ module FacebookAds
|
|
21
21
|
field :advertiser_name, 'string'
|
22
22
|
field :attributed_to_reseller_l7d, 'bool'
|
23
23
|
field :available_guidance, { list: 'string' }
|
24
|
-
field :benchmark_report_link, 'string'
|
25
24
|
field :guidance_adoption_rate_l7d, 'double'
|
26
|
-
field :no_adsets_gte_benchmark, 'int'
|
27
|
-
field :no_adsets_lt_benchmark, 'int'
|
28
25
|
field :nurtured_by_reseller_l7d, 'bool'
|
29
26
|
field :planning_agency_name, 'string'
|
30
27
|
field :recommendation_time, 'datetime'
|
@@ -0,0 +1,216 @@
|
|
1
|
+
# Copyright (c) 2017-present, Facebook, Inc. All rights reserved.
|
2
|
+
#
|
3
|
+
# You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
|
4
|
+
# copy, modify, and distribute this software in source code or binary form for use
|
5
|
+
# in connection with the web services and APIs provided by Facebook.
|
6
|
+
#
|
7
|
+
# As with any software that integrates with the Facebook platform, your use of
|
8
|
+
# this software is subject to the Facebook Platform Policy
|
9
|
+
# [http://developers.facebook.com/policy/]. This copyright notice shall be
|
10
|
+
# included in all copies or substantial portions of the software.
|
11
|
+
#
|
12
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
14
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
15
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
16
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
17
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
18
|
+
|
19
|
+
module FacebookAds
|
20
|
+
module ServerSide
|
21
|
+
|
22
|
+
# AttributionData indicated the attribution data used for attribution passback event to optimize the performance.
|
23
|
+
class AttributionData
|
24
|
+
|
25
|
+
# Touchpoint type.
|
26
|
+
attr_accessor :scope
|
27
|
+
|
28
|
+
# A Unix timestamp in seconds indicating when the campaign_id or fbc was first received.
|
29
|
+
attr_accessor :visit_time
|
30
|
+
|
31
|
+
# Meta-provided ad id from URL/deeplink.
|
32
|
+
attr_accessor :ad_id
|
33
|
+
|
34
|
+
# Meta-provided adset id from URL/deeplink.
|
35
|
+
attr_accessor :adset_id
|
36
|
+
|
37
|
+
# Meta-provided campaign id from URL/deeplink.
|
38
|
+
attr_accessor :campaign_id
|
39
|
+
|
40
|
+
# [0-1] weight of credit assigned to the visit.
|
41
|
+
attr_accessor :attribution_share
|
42
|
+
|
43
|
+
# Attribution model used to attribute the event.
|
44
|
+
attr_accessor :attribution_model
|
45
|
+
|
46
|
+
# Attribution woindow in days.
|
47
|
+
attr_accessor :attr_window
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
# @param [String] scope
|
52
|
+
# @param [Integer] visit_time
|
53
|
+
# @param [String] ad_id
|
54
|
+
# @param [String] adset_id
|
55
|
+
# @param [String] campaign_id
|
56
|
+
# @param [Float] attribution_share
|
57
|
+
# @param [String] attribution_model
|
58
|
+
# @param [String] attr_window
|
59
|
+
def initialize(scope: nil, visit_time: nil, ad_id: nil, adset_id: nil, campaign_id: nil, attribution_share: nil, attribution_model: nil, attr_window: nil)
|
60
|
+
unless scope.nil?
|
61
|
+
self.scope = scope
|
62
|
+
end
|
63
|
+
unless visit_time.nil?
|
64
|
+
self.visit_time = visit_time
|
65
|
+
end
|
66
|
+
unless ad_id.nil?
|
67
|
+
self.ad_id = ad_id
|
68
|
+
end
|
69
|
+
unless adset_id.nil?
|
70
|
+
self.adset_id = adset_id
|
71
|
+
end
|
72
|
+
unless campaign_id.nil?
|
73
|
+
self.campaign_id = campaign_id
|
74
|
+
end
|
75
|
+
unless attribution_share.nil?
|
76
|
+
self.attribution_share = attribution_share
|
77
|
+
end
|
78
|
+
unless attribution_model.nil?
|
79
|
+
self.attribution_model = attribution_model
|
80
|
+
end
|
81
|
+
unless attr_window.nil?
|
82
|
+
self.attr_window = attr_window
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# build the object using the input hash
|
87
|
+
# @param [Hash] attributes attributes in the form of hash
|
88
|
+
def build(attributes = {})
|
89
|
+
return unless attributes.is_a?(Hash)
|
90
|
+
|
91
|
+
# convert string to symbol for hash key
|
92
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
93
|
+
|
94
|
+
if attributes.has_key?(:'scope')
|
95
|
+
self.scope = attributes[:'scope']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.has_key?(:'visit_time')
|
99
|
+
self.visit_time = attributes[:'visit_time']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.has_key?(:'ad_id')
|
103
|
+
self.ad_id = attributes[:'ad_id']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.has_key?(:'adset_id')
|
107
|
+
self.adset_id = attributes[:'adset_id']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.has_key?(:'campaign_id')
|
111
|
+
self.campaign_id = attributes[:'campaign_id']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.has_key?(:'attribution_share')
|
115
|
+
self.attribution_share = attributes[:'attribution_share']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.has_key?(:'attribution_model')
|
119
|
+
self.attribution_model = attributes[:'attribution_model']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.has_key?(:'attr_window')
|
123
|
+
self.attr_window = attributes[:'attr_window']
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
# Checks equality by comparing each attribute.
|
128
|
+
def ==(o)
|
129
|
+
return true if self.equal?(o)
|
130
|
+
self.class == o.class &&
|
131
|
+
scope == o.scope &&
|
132
|
+
visit_time == o.visit_time &&
|
133
|
+
ad_id == o.ad_id &&
|
134
|
+
adset_id == o.adset_id &&
|
135
|
+
campaign_id == o.campaign_id &&
|
136
|
+
attribution_share == o.attribution_share &&
|
137
|
+
attribution_model == o.attribution_model &&
|
138
|
+
attr_window == o.attr_window
|
139
|
+
end
|
140
|
+
|
141
|
+
# @see the `==` method
|
142
|
+
def eql?(o)
|
143
|
+
self == o
|
144
|
+
end
|
145
|
+
|
146
|
+
# Calculates hash code according to all attributes.
|
147
|
+
# @return [Fixnum] Hash code
|
148
|
+
def hash
|
149
|
+
[
|
150
|
+
scope, visit_time, ad_id, adset_id, campaign_id, attribution_share, attribution_model, attr_window
|
151
|
+
].hash
|
152
|
+
end
|
153
|
+
|
154
|
+
def to_s
|
155
|
+
hash = {}
|
156
|
+
unless scope.nil?
|
157
|
+
hash['scope'] = scope
|
158
|
+
end
|
159
|
+
unless visit_time.nil?
|
160
|
+
hash['visit_time'] = visit_time
|
161
|
+
end
|
162
|
+
unless ad_id.nil?
|
163
|
+
hash['ad_id'] = ad_id
|
164
|
+
end
|
165
|
+
unless adset_id.nil?
|
166
|
+
hash['adset_id'] = adset_id
|
167
|
+
end
|
168
|
+
unless campaign_id.nil?
|
169
|
+
hash['campaign_id'] = campaign_id
|
170
|
+
end
|
171
|
+
unless attribution_share.nil?
|
172
|
+
hash['attribution_share'] = attribution_share
|
173
|
+
end
|
174
|
+
unless attribution_model.nil?
|
175
|
+
hash['attribution_model'] = attribution_model
|
176
|
+
end
|
177
|
+
unless attr_window.nil?
|
178
|
+
hash['attr_window'] = attr_window
|
179
|
+
end
|
180
|
+
hash.to_s
|
181
|
+
end
|
182
|
+
|
183
|
+
|
184
|
+
# Normalize input fields to server request format.
|
185
|
+
def normalize
|
186
|
+
hash = {}
|
187
|
+
unless scope.nil?
|
188
|
+
hash['scope'] = scope
|
189
|
+
end
|
190
|
+
unless visit_time.nil?
|
191
|
+
hash['visit_time'] = visit_time
|
192
|
+
end
|
193
|
+
unless ad_id.nil?
|
194
|
+
hash['ad_id'] = ad_id
|
195
|
+
end
|
196
|
+
unless adset_id.nil?
|
197
|
+
hash['adset_id'] = adset_id
|
198
|
+
end
|
199
|
+
unless campaign_id.nil?
|
200
|
+
hash['campaign_id'] = campaign_id
|
201
|
+
end
|
202
|
+
unless attribution_share.nil?
|
203
|
+
hash['attribution_share'] = attribution_share
|
204
|
+
end
|
205
|
+
unless attribution_model.nil?
|
206
|
+
hash['attribution_model'] = attribution_model
|
207
|
+
end
|
208
|
+
unless attr_window.nil?
|
209
|
+
hash['attr_window'] = attr_window
|
210
|
+
end
|
211
|
+
hash
|
212
|
+
end
|
213
|
+
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
@@ -19,6 +19,8 @@
|
|
19
19
|
require_relative './user_data'
|
20
20
|
require_relative './custom_data'
|
21
21
|
require_relative './app_data'
|
22
|
+
require_relative './original_event_data'
|
23
|
+
require_relative './attribution_data'
|
22
24
|
|
23
25
|
module FacebookAds
|
24
26
|
module ServerSide
|
@@ -78,6 +80,12 @@ module FacebookAds
|
|
78
80
|
# Messaging channel for the event
|
79
81
|
attr_accessor :messaging_channel
|
80
82
|
|
83
|
+
# Original event info
|
84
|
+
attr_accessor :original_event_data
|
85
|
+
|
86
|
+
# Attribution data info
|
87
|
+
attr_accessor :attribution_data
|
88
|
+
|
81
89
|
# @param [String] event_name
|
82
90
|
# @param [int] event_time
|
83
91
|
# @param [String] event_source_url
|
@@ -92,6 +100,8 @@ module FacebookAds
|
|
92
100
|
# @param String action_source
|
93
101
|
# @param [String] advanced_measurement_table
|
94
102
|
# @param [String] messaging_channel
|
103
|
+
# @param [FacebookAds::ServerSide::OriginalEventData] original_event_data
|
104
|
+
# @param [FacebookAds::ServerSide::AttributionData] attribution_data
|
95
105
|
def initialize(event_name: nil,
|
96
106
|
event_time: nil,
|
97
107
|
event_source_url: nil,
|
@@ -105,7 +115,9 @@ module FacebookAds
|
|
105
115
|
data_processing_options_state: nil,
|
106
116
|
action_source: nil,
|
107
117
|
advanced_measurement_table: nil,
|
108
|
-
messaging_channel: nil
|
118
|
+
messaging_channel: nil,
|
119
|
+
original_event_data: nil,
|
120
|
+
attribution_data: nil
|
109
121
|
)
|
110
122
|
|
111
123
|
unless event_name.nil?
|
@@ -150,6 +162,12 @@ module FacebookAds
|
|
150
162
|
unless messaging_channel.nil?
|
151
163
|
self.messaging_channel = messaging_channel
|
152
164
|
end
|
165
|
+
unless original_event_data.nil?
|
166
|
+
self.original_event_data = original_event_data
|
167
|
+
end
|
168
|
+
unless attribution_data.nil?
|
169
|
+
self.attribution_data = attribution_data
|
170
|
+
end
|
153
171
|
end
|
154
172
|
|
155
173
|
# build the object using the input hash
|
@@ -215,6 +233,14 @@ module FacebookAds
|
|
215
233
|
if attributes.has_key?(:'messaging_channel')
|
216
234
|
self.messaging_channel = attributes[:'messaging_channel']
|
217
235
|
end
|
236
|
+
|
237
|
+
if attributes.has_key?(:'original_event_data')
|
238
|
+
self.original_event_data = attributes[:'original_event_data']
|
239
|
+
end
|
240
|
+
|
241
|
+
if attributes.has_key?(:'attribution_data')
|
242
|
+
self.attribution_data = attributes[:'attribution_data']
|
243
|
+
end
|
218
244
|
end
|
219
245
|
|
220
246
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -261,8 +287,10 @@ module FacebookAds
|
|
261
287
|
data_processing_options_country == o.data_processing_options_country &&
|
262
288
|
data_processing_options_state == o.data_processing_options_state &&
|
263
289
|
action_source == o.action_source &&
|
264
|
-
advanced_measurement_table == o.advanced_measurement_table
|
265
|
-
messaging_channel == o.messaging_channel
|
290
|
+
advanced_measurement_table == o.advanced_measurement_table &&
|
291
|
+
messaging_channel == o.messaging_channel &&
|
292
|
+
original_event_data == o.original_event_data &&
|
293
|
+
attribution_data == o.attribution_data
|
266
294
|
end
|
267
295
|
|
268
296
|
# @see the `==` method
|
@@ -276,7 +304,7 @@ module FacebookAds
|
|
276
304
|
[
|
277
305
|
event_name, event_time, event_source_url, opt_out, event_id, user_data, custom_data, app_data,
|
278
306
|
data_processing_options, data_processing_options_country, data_processing_options_state,
|
279
|
-
action_source, advanced_measurement_table, messaging_channel,
|
307
|
+
action_source, advanced_measurement_table, messaging_channel, original_event_data, attribution_data
|
280
308
|
].hash
|
281
309
|
end
|
282
310
|
|
@@ -324,6 +352,12 @@ module FacebookAds
|
|
324
352
|
unless messaging_channel.nil?
|
325
353
|
hash['messaging_channel'] = messaging_channel
|
326
354
|
end
|
355
|
+
unless original_event_data.nil?
|
356
|
+
hash['original_event_data'] = original_event_data
|
357
|
+
end
|
358
|
+
unless attribution_data.nil?
|
359
|
+
hash['attribution_data'] = attribution_data
|
360
|
+
end
|
327
361
|
hash.to_s
|
328
362
|
end
|
329
363
|
|
@@ -376,6 +410,12 @@ module FacebookAds
|
|
376
410
|
unless messaging_channel.nil?
|
377
411
|
hash['messaging_channel'] = messaging_channel
|
378
412
|
end
|
413
|
+
unless original_event_data.nil?
|
414
|
+
hash['original_event_data'] = original_event_data
|
415
|
+
end
|
416
|
+
unless attribution_data.nil?
|
417
|
+
hash['attribution_data'] = attribution_data
|
418
|
+
end
|
379
419
|
hash
|
380
420
|
end
|
381
421
|
|