Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fb_login_id to user data #147

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion facebookbusiness.gemspec
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ Gem::Specification.new do |s|
s.required_ruby_version = '>= 3.0'

s.add_dependency 'concurrent-ruby', '~> 1.1'
s.add_dependency 'faraday', '~> 2.6'
s.add_dependency 'faraday', '~> 1.0'
s.add_dependency 'faraday-multipart', '~> 1.0'
s.add_dependency 'json', '~> 2.6'
s.add_dependency 'countries', '>= 3', '< 6'
21 changes: 20 additions & 1 deletion lib/facebook_ads/ad_objects/server_side/user_data.rb
Original file line number Diff line number Diff line change
@@ -195,6 +195,9 @@ def external_id=(external_id)
# The subscription ID for the user in this transaction. This is similar to the order ID for an individual product.
attr_accessor :subscription_id

# ID issued by Facebook when a person first logs into an instance of an app. This is also known as App-Scoped ID.
attr_accessor :fb_login_id

# The lead ID for the user in this transaction. This ID is associated with a lead generated by Facebook's Lead Ads.
attr_accessor :lead_id

@@ -265,6 +268,7 @@ def madid=(madid)
# @param [String] fbc
# @param [String] fbp
# @param [String] subscription_id
# @param [String] fb_login_id
# @param [String] lead_id
# @param [String] f5first
# @param [String] f5last
@@ -281,7 +285,7 @@ def initialize(email: nil, emails: nil, phone: nil, phones: nil, gender: nil, ge
first_name: nil, first_names: nil, city: nil, cities: nil, state: nil, states: nil,
country_code: nil, country_codes: nil, zip_code: nil, zip_codes: nil,
external_id: nil, external_ids: nil, client_ip_address: nil,
client_user_agent: nil, fbc: nil, fbp: nil, subscription_id: nil, lead_id: nil,
client_user_agent: nil, fbc: nil, fbp: nil, subscription_id: nil, fb_login_id: nil, lead_id: nil,
f5first: nil, f5last: nil, fi: nil, dobd: nil, dobm: nil, doby: nil, anon_id: nil, anon_ids: nil, madid:nil, madids: nil)
validate_constructor_values(emails, email, 'emails', 'email')
validate_constructor_values(phones, phone, 'phones', 'phone')
@@ -376,6 +380,9 @@ def initialize(email: nil, emails: nil, phone: nil, phones: nil, gender: nil, ge
unless subscription_id.nil?
self.subscription_id = subscription_id
end
unless fb_login_id.nil?
self.fb_login_id = fb_login_id
end
unless lead_id.nil?
self.lead_id = lead_id
end
@@ -501,6 +508,10 @@ def build(attributes = {})
self.fbp = attributes[:'fbp']
end

if attributes.has_key?(:'fb_login_id')
self.fb_login_id = attributes[:'fb_login_id']
end

if attributes.has_key?(:'lead_id')
self.lead_id = attributes[:'lead_id']
end
@@ -562,6 +573,7 @@ def ==(o)
fbc == o.fbc &&
fbp == o.fbp &&
subscription_id == o.subscription_id &&
fb_login_id == o.fb_login_id &&
lead_id == o.lead_id &&
f5first == o.f5first &&
f5last == o.f5last &&
@@ -598,6 +610,7 @@ def hash
fbc,
fbp,
subscription_id,
fb_login_id,
lead_id,
f5first,
f5last,
@@ -663,6 +676,9 @@ def to_s
unless subscription_id.nil?
hash['subscription_id'] = subscription_id
end
unless fb_login_id.nil?
hash['fb_login_id'] = fb_login_id
end
unless lead_id.nil?
hash['lead_id'] = lead_id
end
@@ -745,6 +761,9 @@ def normalize
unless subscription_id.nil?
hash['subscription_id'] = subscription_id
end
unless fb_login_id.nil?
hash['fb_login_id'] = fb_login_id
end
unless lead_id.nil?
hash['lead_id'] = lead_id
end