forked from llooker/improvado
-
Notifications
You must be signed in to change notification settings - Fork 0
/
adsets_adwords.view.lkml
144 lines (121 loc) · 2.38 KB
/
adsets_adwords.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
view: adsets_adwords {
sql_table_name: public.adsets_raw_table_adwords ;;
dimension: account_id {
type: string
sql: ${TABLE}.account_id ;;
}
dimension: adset_id {
type: string
sql: ${TABLE}.adset_id ;;
}
dimension: adset_name {
type: string
sql: ${TABLE}.adset_name ;;
}
dimension: avg_pos {
type: number
sql: ${TABLE}.avg_pos ;;
}
dimension: campaign_id {
type: string
sql: ${TABLE}.campaign_id ;;
}
dimension: campaign_name {
type: string
sql: ${TABLE}.campaign_name ;;
}
dimension: campaign_type {
type: string
sql: ${TABLE}.campaign_type ;;
}
dimension: clicks {
type: number
sql: ${TABLE}.clicks ;;
}
dimension: conv {
type: number
sql: ${TABLE}.conv ;;
}
dimension_group: date {
type: time
timeframes: [
raw,
date,
week,
month,
quarter,
year
]
convert_tz: no
sql: ${TABLE}.date ;;
}
dimension: date_yyyymmdd {
type: string
sql: ${TABLE}.date_yyyymmdd ;;
}
dimension: imps {
type: number
sql: ${TABLE}.imps ;;
}
dimension: purchase {
type: number
sql: ${TABLE}.purchase ;;
}
dimension: revenue {
type: number
sql: ${TABLE}.revenue ;;
}
dimension: spend {
type: number
sql: ${TABLE}.spend ;;
}
dimension: views {
type: number
sql: ${TABLE}.views ;;
}
measure: cost {
type: sum
sql: ${spend} ;;
drill_fields: [campaign_name, adset_name]
value_format_name: usd
}
measure: conversions {
type: sum
sql: ${conv} ;;
drill_fields: [campaign_name, adset_name]
}
measure: cpa {
type: number
sql: ${cost}::float/NULLIF(${conversions},0) ;;
value_format_name: usd
}
measure: impressions {
type: sum
sql: ${imps} ;;
drill_fields: [campaign_name, adset_name]
}
measure: click {
type: sum
sql: ${clicks} ;;
drill_fields: [campaign_name, adset_name]
}
measure: ctr {
type: number
sql: ${click}::float/NULLIF(${impressions},0) ;;
value_format_name: percent_2
}
measure: conv_rate {
type: number
sql: ${conversions}::float/NULLIF(${click},0) ;;
value_format_name: percent_2
}
measure: cpc {
type: number
sql: ${cost}::float/NULLIF(${click},0) ;;
value_format_name: usd
}
measure: count {
type: count
drill_fields: [campaign_name, adset_name]
}
}