-- Fetch all the Campaigns belonging to the Google
-- Ads account of a particular user.
SELECT *
FROM fiber.google_ads_campaign
WHERE account_id = '{user.google_ads_id}'
-- Fetch all the Campaigns belonging to the Google
-- Ads account of a particular user.
SELECT *
FROM fiber.google_ads_campaign
WHERE account_id = '{user.google_ads_id}'
Code
CREATE TABLE fiber.google_ads_campaign (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
name TEXT,
status TEXT,
serving_status TEXT,
start_date TIMESTAMP WITH TIME ZONE,
end_date TIMESTAMP WITH TIME ZONE,
budget DOUBLE PRECISION,
amount DOUBLE PRECISION,
ad_serving_optimization_status TEXT,
advertising_channel_type TEXT,
advertising_channel_sub_type TEXT,
network_setting JSONB,
frequency_cap JSONB,
settings JSONB,
labels JSONB,
campaign_trial_type TEXT,
base_campaign_id TEXT,
campaign_group_type TEXT,
tracking_url_template TEXT,
final_url_suffix TEXT,
url_custom_parameters JSONB,
vanity_pharma JSONB,
selective_optimization JSONB,
optimization_goal_setting JSONB,
tracking_setting JSONB,
geo_target_type_setting JSONB,
dynamic_search_ads_setting JSONB,
shopping_setting JSONB,
targeting_setting JSONB,
network_settings JSONB,
hotel_setting JSONB,
app_campaign_setting JSONB,
campaign_budget JSONB,
bidding_strategy JSONB,
commission JSONB,
manual_cpc JSONB,
manual_cpm JSONB,
manual_cpv JSONB,
maximize_conversions JSONB,
maximize_conversion_value JSONB,
target_cpa JSONB,
target_impression_share JSONB
)
CREATE TABLE fiber.google_ads_campaign (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
name TEXT,
status TEXT,
serving_status TEXT,
start_date TIMESTAMP WITH TIME ZONE,
end_date TIMESTAMP WITH TIME ZONE,
budget DOUBLE PRECISION,
amount DOUBLE PRECISION,
ad_serving_optimization_status TEXT,
advertising_channel_type TEXT,
advertising_channel_sub_type TEXT,
network_setting JSONB,
frequency_cap JSONB,
settings JSONB,
labels JSONB,
campaign_trial_type TEXT,
base_campaign_id TEXT,
campaign_group_type TEXT,
tracking_url_template TEXT,
final_url_suffix TEXT,
url_custom_parameters JSONB,
vanity_pharma JSONB,
selective_optimization JSONB,
optimization_goal_setting JSONB,
tracking_setting JSONB,
geo_target_type_setting JSONB,
dynamic_search_ads_setting JSONB,
shopping_setting JSONB,
targeting_setting JSONB,
network_settings JSONB,
hotel_setting JSONB,
app_campaign_setting JSONB,
campaign_budget JSONB,
bidding_strategy JSONB,
commission JSONB,
manual_cpc JSONB,
manual_cpm JSONB,
manual_cpv JSONB,
maximize_conversions JSONB,
maximize_conversion_value JSONB,
target_cpa JSONB,
target_impression_share JSONB
)
Model definition