This repository has been archived by the owner on Jul 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
/
google_ads_segmentology.json
executable file
·162 lines (162 loc) · 7.96 KB
/
google_ads_segmentology.json
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
{
"script":{
"released":"2020-08-13",
"license":"Licensed under the Apache License, Version 2.0",
"copyright":"Copyright 2020 Google LLC",
"icon":"donut_large",
"title":"GoogleAds Segmentology",
"description":"GoogleAds funnel analysis using Census data.",
"image":"https://github.com/google/starthinker/raw/master/tutorials/images/segmentology_dv.png",
"sample":"https://datastudio.google.com/c/u/0/reporting/3673497b-f36f-4448-8fb9-3e05ea51842f/",
"documentation":"https://medium.com/starthinker/using-census-data-for-advertising-campaign-funnel-analysis-2fe0ccbdae2c",
"test":"https://github.com/google/starthinker/blob/master/tests/google_ads_segemntology.json",
"from":["google ads", "census"],
"to":["bigquery", "datastudio"],
"pitches":[
"Optimize keywords and landing pages for engaged demographics.",
"Examine Google Ads funnel in terms of demographics.",
"Discover missed marketing opportunities.",
"Run continuously to measure impact of funnel changes."
],
"impacts":{
"spend optimization":100,
"spend growth":100,
"time savings":80,
"account health":90,
"csat improvement":100
},
"instructions":[
"Wait for **BigQuery->{field:recipe_project}->{field:recipe_slug}->Census_Join** to be created.",
"Join the [StarThinker Assets Group](https://groups.google.com/d/forum/starthinker-assets) to access the following assets",
"Copy [GoogleAds Segmentology Sample](https://datastudio.google.com/c/u/0/reporting/3673497b-f36f-4448-8fb9-3e05ea51842f/). Leave the Data Source as is, you will change it in the next step.",
"Click Edit Connection, and change to **BigQuery->{field:recipe_project}->{field:recipe_slug}->Census_Join**.",
"Or give these instructions to the client."
],
"authors":["kenjora@google.com"]
},
"tasks":[
{ "dataset":{
"description":"Create a dataset for bigquery tables.",
"hour":[4],
"auth":{"field":{ "name":"auth_write", "kind":"authentication", "order":1, "default":"service", "description":"Credentials used for writing data." }},
"dataset":{"field":{ "name":"recipe_slug", "kind":"string", "suffix":"_Segmentology", "description":"Place where tables will be created in BigQuery." }}
}},
{ "bigquery":{
"auth":{"field":{ "name":"auth_write", "kind":"authentication", "order":1, "default":"service", "description":"Credentials used for writing function." }},
"function":"Pearson Significance Test",
"to":{
"dataset":{"field":{ "name":"recipe_slug", "kind":"string", "suffix":"_Segmentology", "order":4, "default":"", "description":"Name of Google BigQuery dataset to create." }}
}
}},
{ "google_api": {
"auth":{"field":{ "name":"auth_read", "kind":"authentication", "order":0, "default":"user", "description":"Credentials used for reading data." }},
"api": "googleads",
"version": "v8",
"function": "customers.googleAds.search",
"kwargs":{
"customerId":{"field":{ "name":"customer_id", "kind":"string", "description":"Google Ads customer.", "default":"" }},
"body": { "query":"SELECT
campaign.name,
ad_group.name,
segments.geo_target_postal_code,
metrics.impressions,
metrics.clicks,
metrics.conversions,
metrics.interactions
FROM user_location_view
"}
},
"headers":{
"developer-token":{"field":{ "name":"developer_token", "kind":"string", "description":"Google Ads developer token.", "default":"" }},
"login-customer-id":{"field":{ "name":"login_id", "kind":"string", "description":"Google Ads login.", "default":"" }}
},
"iterate":true,
"results": {
"bigquery": {
"dataset":{"field":{ "name":"recipe_slug", "kind":"string", "suffix":"_Segmentology", "order":4, "default":"", "description":"Name of Google BigQuery dataset to create." }},
"table":"GoogleAds_KPI",
"schema":[
{ "name": "userLocationView", "type": "RECORD", "mode": "NULLABLE", "fields": [
{ "name": "resourceName", "type": "STRING", "mode": "NULLABLE" }
]
},
{ "name": "segments", "type": "RECORD", "mode": "NULLABLE", "fields": [
{ "name": "geoTargetPostalCode", "type": "STRING", "mode": "NULLABLE" }
]
},
{ "name": "metrics", "type": "RECORD", "mode": "NULLABLE", "fields": [
{ "name": "interactions", "type": "INTEGER", "mode": "NULLABLE" },
{ "name": "impressions", "type": "INTEGER", "mode": "NULLABLE" },
{ "name": "conversions", "type": "INTEGER", "mode": "NULLABLE" },
{ "name": "clicks", "type": "INTEGER", "mode": "NULLABLE" }
]
},
{ "name": "adGroup", "type": "RECORD", "mode": "NULLABLE", "fields": [
{ "name": "name", "type": "STRING", "mode": "NULLABLE" },
{ "name": "resourceName", "type": "STRING", "mode": "NULLABLE" }
]
},
{ "name": "campaign", "type": "RECORD", "mode": "NULLABLE", "fields": [
{ "name": "name", "type": "STRING", "mode": "NULLABLE" },
{ "name": "resourceName", "type": "STRING", "mode": "NULLABLE" }
]
}
]
}
}
}},
{ "bigquery": {
"auth":{"field":{ "name":"auth_write", "kind":"authentication", "order":1, "default":"service", "description":"Authorization used for writing data." }},
"from": {
"query":"SELECT
campaign.name AS Campaign,
adGRoup.name AS Ad_Group,
segments.geoTargetPostalCode AS Postal_Code,
SAFE_DIVIDE(metrics.impressions, SUM(metrics.impressions) OVER()) AS Impression,
SAFE_DIVIDE(metrics.clicks, metrics.impressions) AS Click,
SAFE_DIVIDE(metrics.conversions, metrics.impressions) AS Conversion,
SAFE_DIVIDE(metrics.interactions, metrics.impressions) AS Interaction,
metrics.impressions AS Impressions
FROM
`{dataset}.GoogleAds_KPI`;
",
"parameters":{
"dataset":{"field":{ "name":"recipe_slug", "kind":"string", "suffix":"_Segmentology", "description":"Place where tables will be created in BigQuery." }}
},
"legacy":false
},
"to":{
"dataset":{"field":{ "name":"recipe_slug", "kind":"string", "suffix":"_Segmentology", "description":"Place where tables will be written in BigQuery." }},
"view":"GoogleAds_KPI_Normalized"
}
}},
{ "census": {
"auth":{"field":{ "name":"auth_write", "kind":"authentication", "order":1, "default":"service", "description":"Authorization used for writing data." }},
"normalize": {
"census_geography": "zip_codes",
"census_year": "2018",
"census_span": "5yr"
},
"to": {
"dataset":{"field":{ "name":"recipe_slug", "kind":"string", "suffix":"_Segmentology", "order":4, "default":"", "description":"Name of Google BigQuery dataset to create." }},
"type": "view"
}
}},
{ "census": {
"auth":{"field":{ "name":"auth_write", "kind":"authentication", "order":1, "default":"service", "description":"Authorization used for writing data." }},
"correlate": {
"join": "Postal_Code",
"pass": ["Campaign", "Ad_Group"],
"sum": ["Impressions"],
"correlate": ["Impression", "Click", "Conversion", "Interaction"],
"dataset":{"field":{ "name":"recipe_slug", "kind":"string", "suffix":"_Segmentology", "order":4, "default":"", "description":"Name of Google BigQuery dataset to create." }},
"table": "GoogleAds_KPI_Normalized",
"significance": 80
},
"to": {
"dataset":{"field":{ "name":"recipe_slug", "kind":"string", "suffix":"_Segmentology", "order":4, "default":"", "description":"Name of Google BigQuery dataset to create." }},
"type": "view"
}
}}
]
}