From 4254877cb15ca27efc88908fb69d6d7d9dce3565 Mon Sep 17 00:00:00 2001 From: Chris Estreich Date: Thu, 7 Mar 2019 20:12:09 -0800 Subject: [PATCH] Ad more ad set fields (#36) - attribution_spec - start_time - end_time --- CHANGELOG.md | 21 +++++++++++-------- facebook_ads.gemspec | 4 ++-- lib/facebook_ads/ad_set.rb | 5 ++++- .../_ad_sets/lists_ad_sets.yml | 2 +- .../_create_ad_set/creates_valid_ad_set.yml | 6 +++--- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87113b9..d80a3e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,27 +1,30 @@ +## 0.6.7 (2019-03-07) + - Added the following fields to `AdSet`: `attribution_spec`, `start_time` and `end_time`. (#36, @cte) + ## 0.6.6 (2018-11-29) - - Added ability to pass date range when fetching `ad_set_activities`. + - Added ability to pass date range when fetching `ad_set_activities`. (#34, @amosharrafa) ## 0.6.5 (2018-11-26) - - Expose `ad_set_activities` for `ad_sets`. + - Expose `ad_set_activities` for `ad_sets`. (#31, @amosharrafa) ## 0.6.4 (2018-10-03) - - Expose `budget_remaining`, `daily_budget`, `lifetime_budget` for Ad Campaigns. These are needed when we have budgets at the Ad Campaign level and not at the Ad Set level. + - Expose `budget_remaining`, `daily_budget`, `lifetime_budget` for the `AdCampaign` object. You now have the option to set the budget ad the campaign level instead of the ad set level. ## 0.6.3 (2018-05-17) - - Replaced deprecated `is_autobid` with new `bid_strategy` field + - Replaced deprecated `is_autobid` with new `bid_strategy` field. ## 0.6.2 (2018-05-08) - - Set Product Catalog path to `/owned_product_catalogs` for API v2.11 compatibility + - Set Product Catalog path to `/owned_product_catalogs` for API v2.11 compatibility. ## 0.4 (2017-07-25) - - Added ability to pass `bid_amount` parameter when creating ad sets - - Ad Set `is_autobid` parameter now defaults to `nil` rather than `true` + - Added ability to pass `bid_amount` parameter when creating ad sets. + - Ad Set `is_autobid` parameter now defaults to `nil` rather than `true`. ## 0.3 (2017-07-24) - - Added ability to pass `app_link` parameter with ad creatives + - Added ability to pass `app_link` parameter with ad creatives. ## 0.2 (2017-07-20) - - Added ability to configure App Secret to be included with API requests + - Added ability to configure App Secret to be included with API requests. ## 0.1.12 (2017-05-25) - Added complete set of ad campaign objectives. (#9, @cte) diff --git a/facebook_ads.gemspec b/facebook_ads.gemspec index 8dd4d4b..4a0e13a 100644 --- a/facebook_ads.gemspec +++ b/facebook_ads.gemspec @@ -3,10 +3,10 @@ # To publish the next version: # gem build facebook_ads.gemspec -# gem push facebook_ads-0.6.6.gem +# gem push facebook_ads-0.6.7.gem Gem::Specification.new do |s| s.name = 'facebook_ads' - s.version = '0.6.6' + s.version = '0.6.7' s.platform = Gem::Platform::RUBY s.licenses = ['MIT'] s.authors = ['Chris Estreich'] diff --git a/lib/facebook_ads/ad_set.rb b/lib/facebook_ads/ad_set.rb index d83e74b..ca9ff81 100644 --- a/lib/facebook_ads/ad_set.rb +++ b/lib/facebook_ads/ad_set.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module FacebookAds - # https://developers.facebook.com/docs/marketing-api/reference/ad-account/adsets + # https://developers.facebook.com/docs/marketing-api/reference/ad-campaign class AdSet < Base FIELDS = %w[ id @@ -21,6 +21,9 @@ class AdSet < Base lifetime_budget promoted_object targeting + attribution_spec + start_time + end_time created_time updated_time ].freeze diff --git a/spec/fixtures/cassettes/FacebookAds_AdAccount/_ad_sets/lists_ad_sets.yml b/spec/fixtures/cassettes/FacebookAds_AdAccount/_ad_sets/lists_ad_sets.yml index f10c64e..768e95f 100644 --- a/spec/fixtures/cassettes/FacebookAds_AdAccount/_ad_sets/lists_ad_sets.yml +++ b/spec/fixtures/cassettes/FacebookAds_AdAccount/_ad_sets/lists_ad_sets.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://graph.facebook.com/v/act_10152335766987003/adsets?access_token=&appsecret_proof=&effective_status%5B%5D=ACTIVE&fields=id,account_id,campaign_id,name,status,configured_status,effective_status,bid_strategy,bid_amount,billing_event,optimization_goal,pacing_type,daily_budget,budget_remaining,lifetime_budget,promoted_object,targeting,created_time,updated_time&limit=100 + uri: https://graph.facebook.com/v/act_10152335766987003/adsets?access_token=&appsecret_proof=&effective_status%5B%5D=ACTIVE&fields=id,account_id,campaign_id,name,status,configured_status,effective_status,bid_strategy,bid_amount,billing_event,optimization_goal,pacing_type,daily_budget,budget_remaining,lifetime_budget,promoted_object,targeting,attribution_spec,start_time,end_time,created_time,updated_time&limit=100 body: encoding: US-ASCII string: '' diff --git a/spec/fixtures/cassettes/FacebookAds_AdCampaign/_create_ad_set/creates_valid_ad_set.yml b/spec/fixtures/cassettes/FacebookAds_AdCampaign/_create_ad_set/creates_valid_ad_set.yml index 67348d6..7f2589e 100644 --- a/spec/fixtures/cassettes/FacebookAds_AdCampaign/_create_ad_set/creates_valid_ad_set.yml +++ b/spec/fixtures/cassettes/FacebookAds_AdCampaign/_create_ad_set/creates_valid_ad_set.yml @@ -55,11 +55,11 @@ http_interactions: body: encoding: UTF-8 string: '{"id":"120330000008135715"}' - http_version: + http_version: recorded_at: Sat, 26 Aug 2017 00:11:50 GMT - request: method: get - uri: https://graph.facebook.com/v/120330000008135715?access_token=&appsecret_proof=&fields=id,account_id,campaign_id,name,status,configured_status,effective_status,bid_strategy,bid_amount,billing_event,optimization_goal,pacing_type,daily_budget,budget_remaining,lifetime_budget,promoted_object,targeting,created_time,updated_time + uri: https://graph.facebook.com/v/120330000008135715?access_token=&appsecret_proof=&fields=id,account_id,campaign_id,name,status,configured_status,effective_status,bid_strategy,bid_amount,billing_event,optimization_goal,pacing_type,daily_budget,budget_remaining,lifetime_budget,promoted_object,targeting,attribution_spec,start_time,end_time,created_time,updated_time body: encoding: US-ASCII string: '' @@ -109,6 +109,6 @@ http_interactions: encoding: UTF-8 string: '{"id":"120330000008135715","account_id":"10152335766987003","campaign_id":"120330000008134915","name":"Test Ad Set","status":"PAUSED","configured_status":"PAUSED","effective_status":"PAUSED","bid_strategy":"LOWEST_COST_WITHOUT_CAP","billing_event":"IMPRESSIONS","optimization_goal":"IMPRESSIONS","pacing_type":["standard"],"daily_budget":"500","budget_remaining":"0","lifetime_budget":"0","targeting":{"age_max":65,"age_min":29,"app_install_state":"not_installed","genders":[2],"geo_locations":{"countries":["US"],"location_types":["home"]},"user_device":["Android_Smartphone","Android_Tablet"],"user_os":["Android"]},"created_time":"2017-08-25T17:11:47-0700","updated_time":"2017-08-25T17:11:47-0700"}' - http_version: + http_version: recorded_at: Sat, 26 Aug 2017 00:11:50 GMT recorded_with: VCR 3.0.3