facebook_ads 0.6.2 → 0.6.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83605bff62107d23099b480773471578a17a6298
4
- data.tar.gz: d636ff87db8d04c3ee162b4dddf5ece46443566a
3
+ metadata.gz: 103ab340673c4ae87c97e894fa6f6c2dbe3a02c5
4
+ data.tar.gz: 8db58b179cd4f38150e630b9e2edc87dd5d47890
5
5
  SHA512:
6
- metadata.gz: 9a8e9e2319db0d07538b90058d933a29a241484f997c281dd09fcae2ded85f8dee0f5d97f20da75f2cb319d943540b4bc4f7243fa800baa13849c4bdef354d2b
7
- data.tar.gz: 95f5dd675c660da468f49950866c4e8cce31ab252da6a36517594e427027b894579e3651f76bafd34bf95e393795d31b659b5eab5931407560962b2740700801
6
+ metadata.gz: 12c9e8bd1be33b94c4cbd339dc149376d30daf1fd6731bfea6e2621343b2d168224c79194c9f59e42d3cb20ebe04889666e9846d2606266a62ffd54622f30460
7
+ data.tar.gz: 3766749dcfa84ea4c87b47a36340f7095eb9b49660b23abc90d630230f9f8b6144d24e5823a90fec1a1a823d716240391311d3dbb2dc0cafa63f41d58c55afad
@@ -1,3 +1,6 @@
1
+ ## 0.6.3 (2018-05-17)
2
+ - Replaced deprecated `is_autobid` with new `bid_strategy` field
3
+
1
4
  ## 0.6.2 (2018-05-08)
2
5
  - Set Product Catalog path to `/owned_product_catalogs` for API v2.11 compatibility
3
6
 
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ group :development, :test do
5
5
  gem 'awesome_print'
6
6
  gem 'pry'
7
7
  gem 'rake'
8
- gem 'rubocop', '0.47.1'
8
+ gem 'rubocop', '0.49.0'
9
9
  end
10
10
 
11
11
  group :test do
data/README.md CHANGED
@@ -313,11 +313,12 @@ ad_set = campaign.create_ad_set(
313
313
  daily_budget: 500, # This is in cents, so the daily budget here is $5.
314
314
  billing_event: 'IMPRESSIONS',
315
315
  status: 'PAUSED',
316
- is_autobid: true
316
+ bid_strategy: 'LOWEST_COST_WITHOUT_CAP'
317
317
  )
318
318
  ```
319
319
  See FacebookAds::AdSet::OPTIMIZATION_GOALS for a list of all optimization goals.
320
320
  See FacebookAds::AdSet::BILLING_EVENTS for a list of all billing events.
321
+ See FacebookAds::AdSet::BID_STRATEGIES for a list of all bid strategies.
321
322
 
322
323
  Find an ad set by ID:
323
324
  ```ruby
@@ -5,7 +5,7 @@
5
5
  # gem push facebook_ads-0.6.2.gem
6
6
  Gem::Specification.new do |s|
7
7
  s.name = 'facebook_ads'
8
- s.version = '0.6.2'
8
+ s.version = '0.6.3'
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.licenses = ['MIT']
11
11
  s.authors = ['Chris Estreich']
@@ -57,9 +57,10 @@ module FacebookAds
57
57
  AdSet.paginate("/#{id}/adsets", query: { effective_status: effective_status, limit: limit })
58
58
  end
59
59
 
60
- def create_ad_set(name:, promoted_object: {}, targeting:, daily_budget: nil, lifetime_budget: nil, end_time: nil, optimization_goal:, billing_event: 'IMPRESSIONS', status: 'ACTIVE', is_autobid: nil, bid_amount: nil)
60
+ def create_ad_set(name:, promoted_object: {}, targeting:, daily_budget: nil, lifetime_budget: nil, end_time: nil, optimization_goal:, billing_event: 'IMPRESSIONS', status: 'ACTIVE', bid_strategy: nil, bid_amount: nil)
61
61
  raise Exception, "Optimization goal must be one of: #{AdSet::OPTIMIZATION_GOALS.join(', ')}" unless AdSet::OPTIMIZATION_GOALS.include?(optimization_goal)
62
62
  raise Exception, "Billing event must be one of: #{AdSet::BILLING_EVENTS.join(', ')}" unless AdSet::BILLING_EVENTS.include?(billing_event)
63
+ raise Exception, "Bid strategy must be one of: #{AdSet::BID_STRATEGIES.join(', ')}" unless AdSet::BID_STRATEGIES.include?(bid_strategy)
63
64
 
64
65
  if targeting.is_a?(Hash)
65
66
  # NOP
@@ -76,7 +77,7 @@ module FacebookAds
76
77
  optimization_goal: optimization_goal,
77
78
  billing_event: billing_event,
78
79
  status: status,
79
- is_autobid: is_autobid,
80
+ bid_strategy: bid_strategy,
80
81
  bid_amount: bid_amount
81
82
  }
82
83
 
@@ -10,7 +10,7 @@ module FacebookAds
10
10
  # creative_sequence daily_budget effective_status end_time
11
11
  # frequency_cap frequency_cap_reset_period
12
12
  # frequency_control_specs instagram_actor_id
13
- # is_autobid is_average_price_pacing lifetime_budget
13
+ # bid_strategy lifetime_budget
14
14
  # lifetime_frequency_cap lifetime_imps name optimization_goal
15
15
  # pacing_type promoted_object recommendations
16
16
  # recurring_budget_semantics rf_prediction_id rtb_flag
@@ -24,7 +24,7 @@ module FacebookAds
24
24
  id account_id campaign_id
25
25
  name
26
26
  status configured_status effective_status
27
- is_autobid bid_amount billing_event optimization_goal pacing_type
27
+ bid_strategy bid_amount billing_event optimization_goal pacing_type
28
28
  daily_budget budget_remaining lifetime_budget
29
29
  promoted_object
30
30
  targeting
@@ -55,6 +55,11 @@ module FacebookAds
55
55
  APP_DOWNLOADS
56
56
  LANDING_PAGE_VIEWS
57
57
  ].freeze
58
+ BID_STRATEGIES = %w[
59
+ LOWEST_COST_WITHOUT_CAP
60
+ LOWEST_COST_WITH_BID_CAP
61
+ TARGET_COST
62
+ ].freeze
58
63
 
59
64
  # belongs_to ad_account
60
65
 
@@ -42,7 +42,7 @@ describe FacebookAds::AdCampaign do
42
42
  daily_budget: 500, # This is in cents, so the daily budget here is $5.
43
43
  billing_event: 'IMPRESSIONS',
44
44
  status: 'PAUSED',
45
- is_autobid: true
45
+ bid_strategy: 'LOWEST_COST_WITHOUT_CAP'
46
46
  )
47
47
  expect(ad_set.id).to eq('120330000008135715')
48
48
  end
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://graph.facebook.com/v<api_version>/act_10152335766987003/adsets?access_token=<access_token>&appsecret_proof=<appsecret_proof>&effective_status%5B%5D=ACTIVE&fields=id,account_id,campaign_id,name,status,configured_status,effective_status,is_autobid,bid_amount,billing_event,optimization_goal,pacing_type,daily_budget,budget_remaining,lifetime_budget,promoted_object,targeting,created_time,updated_time&limit=100
5
+ uri: https://graph.facebook.com/v<api_version>/act_10152335766987003/adsets?access_token=<access_token>&appsecret_proof=<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
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://graph.facebook.com/v<api_version>/act_10152335766987003/adsets
6
6
  body:
7
7
  encoding: UTF-8
8
- string: campaign_id=120330000008134915&name=Test+Ad+Set&targeting=%7B%22genders%22%3A%5B2%5D%2C%22age_min%22%3A29%2C%22age_max%22%3A65%2C%22geo_locations%22%3A%7B%22countries%22%3A%5B%22US%22%5D%7D%2C%22user_os%22%3A%5B%22Android%22%5D%2C%22user_device%22%3A%5B%22Android_Smartphone%22%2C%22Android_Tablet%22%5D%2C%22app_install_state%22%3A%22not_installed%22%2C%22income%22%3A%5B%5D%7D&promoted_object=%7B%7D&optimization_goal=IMPRESSIONS&billing_event=IMPRESSIONS&status=PAUSED&is_autobid=true&daily_budget=500&access_token=<access_token>&appsecret_proof=<appsecret_proof>
8
+ string: campaign_id=120330000008134915&name=Test+Ad+Set&targeting=%7B%22genders%22%3A%5B2%5D%2C%22age_min%22%3A29%2C%22age_max%22%3A65%2C%22geo_locations%22%3A%7B%22countries%22%3A%5B%22US%22%5D%7D%2C%22user_os%22%3A%5B%22Android%22%5D%2C%22user_device%22%3A%5B%22Android_Smartphone%22%2C%22Android_Tablet%22%5D%2C%22app_install_state%22%3A%22not_installed%22%2C%22income%22%3A%5B%5D%7D&promoted_object=%7B%7D&optimization_goal=IMPRESSIONS&billing_event=IMPRESSIONS&status=PAUSED&bid_strategy=LOWEST_COST_WITHOUT_CAP&daily_budget=500&access_token=<access_token>&appsecret_proof=<appsecret_proof>
9
9
  headers:
10
10
  Accept:
11
11
  - application/json
@@ -59,7 +59,7 @@ http_interactions:
59
59
  recorded_at: Sat, 26 Aug 2017 00:11:50 GMT
60
60
  - request:
61
61
  method: get
62
- uri: https://graph.facebook.com/v<api_version>/120330000008135715?access_token=<access_token>&appsecret_proof=<appsecret_proof>&fields=id,account_id,campaign_id,name,status,configured_status,effective_status,is_autobid,bid_amount,billing_event,optimization_goal,pacing_type,daily_budget,budget_remaining,lifetime_budget,promoted_object,targeting,created_time,updated_time
62
+ uri: https://graph.facebook.com/v<api_version>/120330000008135715?access_token=<access_token>&appsecret_proof=<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
63
63
  body:
64
64
  encoding: US-ASCII
65
65
  string: ''
@@ -108,7 +108,7 @@ http_interactions:
108
108
  body:
109
109
  encoding: UTF-8
110
110
  string: '{"id":"120330000008135715","account_id":"10152335766987003","campaign_id":"120330000008134915","name":"Test
111
- Ad Set","status":"PAUSED","configured_status":"PAUSED","effective_status":"PAUSED","is_autobid":true,"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"}'
111
+ 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"}'
112
112
  http_version:
113
113
  recorded_at: Sat, 26 Aug 2017 00:11:50 GMT
114
114
  recorded_with: VCR 3.0.3
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facebook_ads
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Estreich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-08 00:00:00.000000000 Z
11
+ date: 2018-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  requirements: []
138
138
  rubyforge_project:
139
- rubygems_version: 2.5.2
139
+ rubygems_version: 2.6.14
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: Facebook Marketing API SDK for Ruby.