cleanup around app-config
This commit is contained in:
parent
e1cc5483a2
commit
9b0a9d1f32
|
|
@ -6,8 +6,8 @@ class CapiTransmitter
|
|||
|
||||
def self.send_event(event_name, user, custom_data = {}, event_source_url = nil)
|
||||
begin
|
||||
pixel_id = APP_CONFIG[:facebook_pixel_id]
|
||||
access_token = APP_CONFIG[:facebook_access_token]
|
||||
pixel_id = APP_CONFIG.facebook_pixel_id
|
||||
access_token = APP_CONFIG.facebook_access_token
|
||||
|
||||
if pixel_id.blank? || access_token.blank?
|
||||
Rails.logger.warn("CapiTransmitter: Missing Facebook Pixel ID or Access Token. Skipping event #{event_name}.")
|
||||
|
|
@ -16,8 +16,8 @@ class CapiTransmitter
|
|||
|
||||
# Construct the User Data object
|
||||
user_data = {
|
||||
client_ip_address: user.current_sign_in_ip,
|
||||
client_user_agent: user.user_agent # Note: User model might not have user_agent stored directly, might need to pass it or rely on what's available
|
||||
# client_ip_address: user.current_sign_in_ip,
|
||||
# client_user_agent: user.user_agent # Note: User model might not have user_agent stored directly, might need to pass it or rely on what's available
|
||||
}
|
||||
|
||||
# Enhance user data with hashed PII if available
|
||||
|
|
@ -49,7 +49,7 @@ class CapiTransmitter
|
|||
|
||||
http = Net::HTTP.new(url.host, url.port)
|
||||
|
||||
if APP_CONFIG[:facebook_conversion_api_tls] == false
|
||||
if APP_CONFIG.facebook_conversion_api_tls == false
|
||||
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
||||
else
|
||||
http.use_ssl = true
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ namespace :capi do
|
|||
desc "Test Facebook CAPI connection"
|
||||
task :test_connection => :environment do
|
||||
puts "Testing CAPI connection..."
|
||||
pixel_id = APP_CONFIG[:facebook_pixel_id]
|
||||
access_token = APP_CONFIG[:facebook_access_token]
|
||||
pixel_id = APP_CONFIG.facebook_pixel_id
|
||||
access_token = APP_CONFIG.facebook_access_token
|
||||
|
||||
puts "Pixel ID: #{pixel_id}"
|
||||
puts "Access Token: #{access_token.try(:truncate, 10)}"
|
||||
|
|
|
|||
|
|
@ -180,6 +180,18 @@ def web_config
|
|||
def max_invites_to_receiver_per_day
|
||||
1000 # a low number only hinders test; the ruby rspec test have a lower value and test this feature
|
||||
end
|
||||
|
||||
def facebook_pixel_id
|
||||
'1234567890'
|
||||
end
|
||||
|
||||
def facebook_access_token
|
||||
'dummy_token'
|
||||
end
|
||||
|
||||
def facebook_conversion_api_tls
|
||||
true
|
||||
end
|
||||
end
|
||||
klass.new
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue