This repository has been archived by the owner on Feb 16, 2023. It is now read-only.
forked from llooker/segment_marketing_attribution
-
Notifications
You must be signed in to change notification settings - Fork 0
/
facebook_insights.view.lkml
198 lines (171 loc) · 4.04 KB
/
facebook_insights.view.lkml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
view: facebook_insights {
sql_table_name: @{FACEBOOK_SCHEMA_NAME}.insights ;;
dimension: id {
primary_key: yes
type: string
sql: ${TABLE}.id ;;
}
dimension: ad_id {
type: string
# hidden: yes
sql: ${TABLE}.ad_id ;;
}
measure: call_to_action_clicks {
type: sum
sql: ${TABLE}.call_to_action_clicks ;;
drill_fields: [campaigns.name, ads.name, call_to_action_clicks]
}
measure: clicks {
type: sum
sql: ${TABLE}.clicks ;;
drill_fields: [campaigns.name, ads.name, clicks]
}
dimension_group: date_start {
type: time
timeframes: [
raw,
time,
date,
week,
month,
quarter,
year
]
sql: ${TABLE}.date_start ;;
}
dimension_group: date_stop {
type: time
timeframes: [
raw,
time,
date,
week,
month,
quarter,
year
]
sql: ${TABLE}.date_stop ;;
}
measure: deeplink_clicks {
type: sum
sql: ${TABLE}.deeplink_clicks ;;
drill_fields: [campaigns.name, ads.name, deeplink_clicks]
}
dimension: frequency {
type: number
sql: ${TABLE}.frequency ;;
}
measure: average_frequency {
type: average
sql: ${frequency} ;;
value_format_name: decimal_1
drill_fields: [campaigns.name, ads.name, average_frequency]
}
measure: impressions {
type: sum
sql: ${TABLE}.impressions ;;
drill_fields: [campaigns.name, ads.name, impressions]
}
measure: inline_post_engagements {
type: sum
sql: ${TABLE}.inline_post_engagements ;;
}
measure: link_clicks {
type: sum
sql: ${TABLE}.link_clicks ;;
drill_fields: [campaigns.name, ads.name, link_clicks]
}
measure: newsfeed_clicks {
type: sum
sql: ${TABLE}.newsfeed_clicks ;;
drill_fields: [campaigns.name, ads.name, newsfeed_clicks]
}
measure: newsfeed_impressions {
type: sum
sql: ${TABLE}.newsfeed_impressions ;;
drill_fields: [campaigns.name, ads.name, newsfeed_impressions]
}
measure: reach {
type: sum
sql: ${TABLE}.reach ;;
drill_fields: [campaigns.name, ads.name, reach]
}
dimension_group: received {
type: time
timeframes: [
raw,
time,
date,
week,
month,
quarter,
year
]
sql: ${TABLE}.received_at ;;
}
measure: social_clicks {
type: sum
sql: ${TABLE}.social_clicks ;;
drill_fields: [campaigns.name, ads.name, social_clicks]
}
measure: social_impressions {
type: sum
sql: ${TABLE}.social_impressions ;;
drill_fields: [campaigns.name, ads.name, social_impressions]
}
measure: social_spend {
type: sum
sql: ${TABLE}.social_spend ;;
}
measure: spend {
type: sum
sql: ${TABLE}.spend ;;
value_format_name: usd
drill_fields: [facebook_campaigns.name, facebook_ads.name, spend]
}
measure: unique_clicks {
type: sum
sql: ${TABLE}.unique_clicks ;;
drill_fields: [facebook_campaigns.name, facebook_ads.name, unique_clicks]
}
measure: unique_impressions {
type: sum
sql: ${TABLE}.unique_impressions ;;
drill_fields: [facebook_campaigns.name, facebook_ads.name, unique_impressions]
}
measure: unique_social_clicks {
type: sum
sql: ${TABLE}.unique_social_clicks ;;
drill_fields: [facebook_campaigns.name, facebook_ads.name, unique_social_clicks]
}
dimension_group: uuid_ts {
type: time
timeframes: [
raw,
time,
date,
week,
month,
quarter,
year
]
sql: ${TABLE}.uuid_ts ;;
}
measure: website_clicks {
type: sum
sql: ${TABLE}.website_clicks ;;
drill_fields: [facebook_campaigns.name, facebook_ads.name, website_clicks]
}
measure: cost_per_click {
type: number
sql: ${spend}/NULLIF(${clicks},0) ;;
value_format_name: usd
drill_fields: [facebook_campaigns.name, facebook_ads.name, cost_per_click]
}
measure: click_through_rate {
type: number
sql: ${clicks}/NULLIF(${impressions},0) ;;
value_format_name: percent_1
drill_fields: [facebook_campaigns.name, facebook_ads.name, click_through_rate]
}
}