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

Dashboard colors and "Meta" string hardcoded changes #4

Merged
merged 4 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
69 changes: 32 additions & 37 deletions dashboards/campaign_manager.dashboard.lookml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: newspaper
preferred_viewer: dashboards-next
description: ''
preferred_slug: LpNUc4vomVE8qUYAq2DIAV
preferred_slug: CxGpfZFvkkzx6V9plbYeMH
elements:
- title: Total Spend
name: Total Spend
Expand Down Expand Up @@ -63,7 +63,6 @@
- name: ''
type: text
title_text: ''
subtitle_text: ''
body_text: |-
<div style="border-bottom: solid 1px #4285F4;">

Expand Down Expand Up @@ -748,11 +747,10 @@
model: pacing_block
explore: multisource_ads
type: looker_column
fields: [multisource_ads.CTR, multisource_ads.ad_source, ad_source]
pivots: [multisource_ads.ad_source]
fields: [multisource_ads.CTR, multisource_ads.ad_source]
filters:
multisource_ads.KPI_select: total^_impressions
sorts: [multisource_ads.ad_source, multisource_ads.CTR desc 0]
sorts: [multisource_ads.CTR desc]
limit: 5
column_limit: 50
dynamic_fields:
Expand All @@ -772,7 +770,7 @@
y_axis_tick_density: default
y_axis_tick_density_custom: 5
show_x_axis_label: false
show_x_axis_ticks: false
show_x_axis_ticks: true
y_axis_scale_mode: linear
x_axis_reversed: false
y_axis_reversed: false
Expand All @@ -797,8 +795,9 @@
x_axis_zoom: true
y_axis_zoom: true
hidden_series: []
font_size: ''
series_colors:
multisource_ads.CTR: "#009c8c"
multisource_ads.CTR: "#34A853"
GAds - SEARCH_PARTNERS - multisource_ads.CTR: "#FEEFC3"
GAds - UNKNOWN - multisource_ads.CTR: "#D2E3FC"
GAds - UNSPECIFIED - multisource_ads.CTR: "#FAD2CF"
Expand Down Expand Up @@ -833,18 +832,17 @@
Campaign Name: multisource_ads.campaign_name
row: 18
col: 0
width: 6
height: 9
width: 12
height: 6
- title: CPM by Source
name: CPM by Source
model: pacing_block
explore: multisource_ads
type: looker_column
fields: [multisource_ads.CPM, multisource_ads.ad_source, ad_source]
pivots: [multisource_ads.ad_source]
fields: [multisource_ads.CPM, multisource_ads.ad_source]
filters:
multisource_ads.KPI_select: total^_impressions
sorts: [multisource_ads.ad_source, multisource_ads.CPM desc 0]
sorts: [multisource_ads.ad_source, multisource_ads.CPM desc]
limit: 5
column_limit: 50
dynamic_fields:
Expand All @@ -864,7 +862,7 @@
y_axis_tick_density: default
y_axis_tick_density_custom: 5
show_x_axis_label: false
show_x_axis_ticks: false
show_x_axis_ticks: true
y_axis_scale_mode: linear
x_axis_reversed: false
y_axis_reversed: false
Expand Down Expand Up @@ -895,7 +893,7 @@
y_axis_zoom: true
series_colors:
multisource_ads.CTR: "#34A853"
multisource_ads.CPM: "#06402b"
multisource_ads.CPM: "#34A853"
GAds - SEARCH_PARTNERS - multisource_ads.CPM: "#FEEFC3"
GAds - UNKNOWN - multisource_ads.CPM: "#D2E3FC"
GAds - UNSPECIFIED - multisource_ads.CPM: "#FAD2CF"
Expand Down Expand Up @@ -931,18 +929,17 @@
Campaign Name: multisource_ads.campaign_name
row: 18
col: 12
width: 6
height: 9
width: 12
height: 6
- title: CPC by Source
name: CPC by Source
model: pacing_block
explore: multisource_ads
type: looker_column
fields: [multisource_ads.CPC, multisource_ads.ad_source, ad_source]
pivots: [multisource_ads.ad_source]
fields: [multisource_ads.CPC, multisource_ads.ad_source]
filters:
multisource_ads.KPI_select: total^_impressions
sorts: [multisource_ads.ad_source, multisource_ads.CPC desc 0]
sorts: [multisource_ads.ad_source, multisource_ads.CPC desc]
limit: 5
column_limit: 50
dynamic_fields:
Expand All @@ -962,7 +959,7 @@
y_axis_tick_density: default
y_axis_tick_density_custom: 5
show_x_axis_label: false
show_x_axis_ticks: false
show_x_axis_ticks: true
y_axis_scale_mode: linear
x_axis_reversed: false
y_axis_reversed: false
Expand All @@ -988,7 +985,7 @@
y_axis_zoom: true
series_colors:
multisource_ads.CTR: "#34A853"
multisource_ads.CPC: "#111184"
multisource_ads.CPC: "#34A853"
GAds - SEARCH_PARTNERS - multisource_ads.CPC: "#FEEFC3"
GAds - UNKNOWN - multisource_ads.CPC: "#D2E3FC"
GAds - UNSPECIFIED - multisource_ads.CPC: "#FAD2CF"
Expand Down Expand Up @@ -1021,20 +1018,19 @@
Ad Source: multisource_ads.ad_source
Date: multisource_ads.partition_date_date
Campaign Name: multisource_ads.campaign_name
row: 18
col: 6
width: 6
height: 9
row: 24
col: 0
width: 12
height: 6
- title: Conversion Rate by Source
name: Conversion Rate by Source
model: pacing_block
explore: multisource_ads
type: looker_column
fields: [multisource_ads.conversion_rate, multisource_ads.ad_source, ad_source]
pivots: [multisource_ads.ad_source]
fields: [multisource_ads.conversion_rate, multisource_ads.ad_source]
filters:
multisource_ads.KPI_select: total^_impressions
sorts: [multisource_ads.ad_source, multisource_ads.conversion_rate desc 0]
sorts: [multisource_ads.conversion_rate desc]
limit: 5
column_limit: 50
dynamic_fields:
Expand All @@ -1054,7 +1050,7 @@
y_axis_tick_density: default
y_axis_tick_density_custom: 5
show_x_axis_label: false
show_x_axis_ticks: false
show_x_axis_ticks: true
y_axis_scale_mode: linear
x_axis_reversed: false
y_axis_reversed: false
Expand Down Expand Up @@ -1083,7 +1079,7 @@
series_colors:
multisource_ads.CTR: "#34A853"
multisource_ads.CPC: "#34A853"
multisource_ads.conversion_rate: "#54664a"
multisource_ads.conversion_rate: "#34A853"
GAds - SEARCH_PARTNERS - multisource_ads.conversion_rate: "#FEEFC3"
GAds - UNKNOWN - multisource_ads.conversion_rate: "#D2E3FC"
GAds - UNSPECIFIED - multisource_ads.conversion_rate: "#FAD2CF"
Expand Down Expand Up @@ -1117,10 +1113,10 @@
Ad Source: multisource_ads.ad_source
Date: multisource_ads.partition_date_date
Campaign Name: multisource_ads.campaign_name
row: 18
col: 18
width: 6
height: 9
row: 24
col: 12
width: 12
height: 6
- title: Conversion rate
name: Conversion rate
model: pacing_block
Expand Down Expand Up @@ -1179,7 +1175,6 @@
- name: Scorecards
type: text
title_text: Scorecards
subtitle_text: ''
body_text: ''
row: 3
col: 0
Expand Down Expand Up @@ -1280,7 +1275,7 @@
Ad Source: multisource_ads.ad_source
Date: multisource_ads.partition_date_date
Campaign Name: multisource_ads.campaign_name
row: 27
row: 30
col: 0
width: 24
height: 7
Expand Down Expand Up @@ -1379,7 +1374,7 @@
Ad Source: multisource_ads.ad_source
Date: multisource_ads.partition_date_date
Campaign Name: multisource_ads.campaign_name
row: 34
row: 37
col: 0
width: 24
height: 7
Expand Down
2 changes: 1 addition & 1 deletion views/fb_ads_views/base_views/ad_insights.view.lkml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ view: ad_insights {
dimension: ad_source {
description: "Dummy data, using just facebook at the moment"
type: string
sql: "Facebook" ;;
sql: "Meta" ;;
}
dimension: buying_type {
description: "The method by which you pay for and target ads in your campaigns: through dynamic auction bidding,
Expand Down
2 changes: 1 addition & 1 deletion views/fb_ads_views/derived_views/dt_fb_ads.view.lkml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sql:
ad_insights.CampaignName AS campaign_name,
ad_insights.AdSetId AS ad_set_id,
ad_insights.AdSetName AS ad_set_name,
ad_insights.meta_ads_source AS ad_source,
"Meta" AS ad_source,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this hardcoded??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ad_insights.meta_ads_source is a synthetic column we generated for testing purposes, not part of the original Meta data transfer.

The data transfer as far as I know doesn't have a column to identify "Instagram" or "Facebook", but we need to be able to check from which source this derived table is pulling data from regardless of that. That's because Meta derived table is part of the code to generate the multisource DT: https://github.com/looker-open-source/pacing-ads-block/blob/master/views/pacing_block/multisource_ads.view.lkml

Any more doubts feel free to ask.
Thanks!

ad_insights.AdId AS ad_id,
ad_insights.AdName AS ad_name,
ROUND(COALESCE(CAST( ( SUM(DISTINCT (CAST(ROUND(COALESCE( ad_insights.Spend ,0)*(1/1000*1.0), 9) AS NUMERIC) + (cast(cast(concat('0x', substr(to_hex(md5(CAST( ad_insights.primary_key AS STRING))), 1, 15)) as int64) as numeric) * 4294967296 + cast(cast(concat('0x', substr(to_hex(md5(CAST( ad_insights.primary_key AS STRING))), 16, 8)) as int64) as numeric)) * 0.000000001 )) - SUM(DISTINCT (cast(cast(concat('0x', substr(to_hex(md5(CAST( ad_insights.primary_key AS STRING))), 1, 15)) as int64) as numeric) * 4294967296 + cast(cast(concat('0x', substr(to_hex(md5(CAST( ad_insights.primary_key AS STRING))), 16, 8)) as int64) as numeric)) * 0.000000001) ) / (1/1000*1.0) AS NUMERIC), 0), 6) AS total_spent,
Expand Down