Add paid = cpc on jammers cohots

This commit is contained in:
Seth Call 2026-02-04 19:53:00 -06:00
parent 51838fb413
commit fad1f9d6d9
3 changed files with 13 additions and 8 deletions

View File

@ -36,10 +36,10 @@ ActiveAdmin.register_page "Jammers Subscription Cohorts" do
filter_ad_set = params[:filter_ad_set]
filter_ad_name = params[:filter_ad_name]
campaigns = User.where("origin_utm_source ILIKE '%meta%'").distinct.pluck(:origin_utm_campaign).compact.sort
campaign_ids = User.where("origin_utm_source ILIKE '%meta%'").distinct.pluck(:origin_id).compact.sort
ad_sets = User.where("origin_utm_source ILIKE '%meta%'").distinct.pluck(:origin_term).compact.sort
ad_names = User.where("origin_utm_source ILIKE '%meta%'").distinct.pluck(:origin_content).compact.sort
campaigns = User.where("origin_utm_medium = 'cpc'").distinct.pluck(:origin_utm_campaign).compact.sort
campaign_ids = User.where("origin_utm_medium = 'cpc'").distinct.pluck(:origin_id).compact.sort
ad_sets = User.where("origin_utm_medium = 'cpc'").distinct.pluck(:origin_term).compact.sort
ad_names = User.where("origin_utm_medium = 'cpc'").distinct.pluck(:origin_content).compact.sort
div style: "margin-bottom: 20px; padding: 10px; background-color: #f4f4f4; border-radius: 4px;" do
form action: admin_jammers_subscription_cohorts_path, method: :get do
@ -60,7 +60,9 @@ ActiveAdmin.register_page "Jammers Subscription Cohorts" do
option c, value: c, selected: filter_campaign == c
end
end
end
div style: "margin-top: 10px;" do
span "Campaign ID: ", style: "font-weight: bold; margin-right: 5px;"
select name: 'filter_campaign_id', onchange: 'this.form.submit()', style: "margin-right: 15px;" do
option "All", value: ''
@ -81,6 +83,7 @@ ActiveAdmin.register_page "Jammers Subscription Cohorts" do
end
end
div style: "margin-top: 10px;" do
span "Ad Name: ", style: "font-weight: bold; margin-right: 5px;"
select name: 'filter_ad_name', onchange: 'this.form.submit()', style: "margin-right: 15px;" do
option "All", value: ''
@ -91,6 +94,7 @@ ActiveAdmin.register_page "Jammers Subscription Cohorts" do
end
end
end
end
noscript { input type: :submit, value: "Filter" }
end
end

View File

@ -8,7 +8,8 @@ ActiveAdmin.register JamRuby::User, :as => 'UserSource' do
config.filters = false
config.per_page = 250
scope("Standard", default: true) { |scope| scope.unscoped.where("origin_utm_source != 'organic' OR origin_utm_source IS NULL").order('created_at desc') }
scope("Paid", default: true) { |scope| scope.unscoped.where(:origin_utm_medium => 'cpc').order('created_at desc') }
scope("Inorganic Source") { |scope| scope.unscoped.where("origin_utm_source != 'organic' OR origin_utm_source IS NULL").order('created_at desc') }
scope("Include Organic") { |scope| scope.unscoped.order('created_at desc') }
index do

View File

@ -174,7 +174,7 @@ if defined?(Bundler)
config.google_public_server_key = "AIzaSyCPTPq5PEcl4XWcm7NZ2IGClZlbsiE8JNo"
# Facebook Conversions API
config.facebook_ad_source = Set.new(['facebook', 'instagram', 'meta', 'meta_ads', 'fb', 'ig'])
config.facebook_ad_source = Set.new(['facebook', 'instagram', 'meta', 'meta_ads', 'fb', 'ig', 'th', 'threads'])
config.facebook_pixel_id = "25663975269956141" # ONLY ONE. NO MULTI ENV
config.facebook_access_token = "EABAGQTtcGk4BQewKCztlfImT86ZAPsRAm3KDrYWsOFZAdLtJCa7bVOzdnZCnHZBFZBRMFVoSZCQdIpX01xXDM0ZCFmYrkPuAHdLsNBU61c7MZCZBLCFd3Q0qrxiJkeYr3F8FH3p98d0tGKljplhJ8vWBIKAiBXaUCCYk6urZB5qZAIEPsppWZCHOep91xZCtMVqtbGJQfFAZDZD" # ONLY ONE. NO MULTI ENV
config.facebook_conversion_api_tls = true