facebook_ads 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 70fa12a0d54cd517252ce2bbcd562b951f698279
4
- data.tar.gz: f296ab2e5a3d8ee496f8f51afb94cd1b0307fae0
3
+ metadata.gz: bf22df6e62e386f9fcdb2f9e7d9be3edafb0ff7d
4
+ data.tar.gz: 0327f5a21d3963224a14c2b429eb9be040476e93
5
5
  SHA512:
6
- metadata.gz: 8afed8760dc4ef008eba4d5ae8ce4ae31754bd980edcc4f35312e739d165a73bc84ae57ce93947d0642a3c3a3ac94d42893fd236536b6d01788852fa39ddc61e
7
- data.tar.gz: 2dedaafa25aabbbcb7e9e080949198a80db26df3ae41d5ff3a0b6dbfd8a6b0a8e5414d4605713b984170f18bfba836a6aef5a6fe4b1e8bc187005d86c2898c14
6
+ metadata.gz: b834ddb9ab674ad353d74171ea3ad90822ac1298b50a2b83d4f62595d93b6738c234736a98a70f823a9df0cd86dadadfa113c24544ee7e770b268a9a40da2be5
7
+ data.tar.gz: d7027a82225878643cb3f1de1dee0c744cf1a6122412114fc5a752ea07fc1c4831e4d555f5f5f749746a45a109e5a6a0902df375ebc50ee409316f3774bca72f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- facebook_ads (0.1.10)
4
+ facebook_ads (0.1.11)
5
5
  hashie (~> 3.4)
6
6
  rest-client (>= 1.6)
7
7
 
data/facebook_ads.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # To release a new version:
2
2
  # gem build facebook_ads.gemspec
3
- # gem push facebook_ads-0.1.9.gem
3
+ # gem push facebook_ads-0.1.11.gem
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'facebook_ads'
6
- s.version = '0.1.10'
6
+ s.version = '0.1.11'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.licenses = ['MIT']
9
9
  s.authors = ['Chris Estreich']
@@ -5,8 +5,8 @@ module FacebookAds
5
5
  FIELDS = %w(id account_id account_status age created_time currency name).freeze
6
6
 
7
7
  class << self
8
- def all
9
- get('/me/adaccounts', objectify: true)
8
+ def all(query = {})
9
+ get('/me/adaccounts', query: query, objectify: true)
10
10
  end
11
11
 
12
12
  def find_by(conditions)
@@ -102,6 +102,19 @@ module FacebookAds
102
102
  self.class.get("/#{id}/advertisable_applications", objectify: false)
103
103
  end
104
104
 
105
+ def create_ad_audience_with_pixel(name:, pixel_id:, event_name:)
106
+ query = {
107
+ name: name,
108
+ pixel_id: pixel_id,
109
+ subtype: 'WEBSITE',
110
+ retention_days: 15,
111
+ rule: { event: { i_contains: event_name } }.to_json,
112
+ prefill: 1
113
+ }
114
+ result = AdAudience.post("/#{id}/customaudiences", query: query)
115
+ AdAudience.find(result['id'])
116
+ end
117
+
105
118
  private
106
119
 
107
120
  def create_carousel_ad_creative(creative)
@@ -4,8 +4,8 @@ module FacebookAds
4
4
  FIELDS = %w(id name vertical product_count feed_count).freeze
5
5
 
6
6
  class << self
7
- def all
8
- get("/#{FacebookAds.business_id}/product_catalogs", objectify: true)
7
+ def all(query = {})
8
+ get("/#{FacebookAds.business_id}/product_catalogs", query: query, objectify: true)
9
9
  end
10
10
 
11
11
  def find_by(conditions)
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.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Estreich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-18 00:00:00.000000000 Z
11
+ date: 2017-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  version: '0'
120
120
  requirements: []
121
121
  rubyforge_project:
122
- rubygems_version: 2.4.8
122
+ rubygems_version: 2.6.8
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: Facebook Marketing API SDK for Ruby.