Skip to content

Commit 1d2434e

Browse files
authored
Changes for release v20_0. (#1008)
1 parent 4f350a8 commit 1d2434e

File tree

1,768 files changed

+402627
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,768 files changed

+402627
-168
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
* 27.0.0
2+
- Google Ads API v20_0 release.
3+
- Remove Google Ads API v17.
4+
- Add example for generating audience insights.
5+
- Add example for creating demand gen campaign.
6+
17
* 26.1.0
28
- Google Ads API v19_1 release.
39
- Add two new examples for budget recommendations.

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ RUN apt-get update -qy && \
2222
python3.10 \
2323
python3.11 \
2424
python3.12 && \
25-
curl -fsSo /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py && \
25+
curl -fsSo /tmp/get-pip.py https://bootstrap.pypa.io/pip/3.8/get-pip.py && \
2626
python3.8 /tmp/get-pip.py && \
2727
python3.8 -m pip install --no-cache-dir --upgrade pip && \
2828
python3.9 /tmp/get-pip.py && \
@@ -37,4 +37,4 @@ RUN apt-get update -qy && \
3737
python3 -m pip install --no-cache-dir "nox>=2020.12.31,<2022.6" && \
3838
rm -rf /var/cache/apt/lists
3939

40-
WORKDIR "/google-ads-python"
40+
WORKDIR "/google-ads-python"

examples/account_management/create_customer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from google.ads.googleads.client import GoogleAdsClient
2929
from google.ads.googleads.errors import GoogleAdsException
3030

31+
3132
# [START create_customer]
3233
def main(client, manager_customer_id):
3334
customer_service = client.get_service("CustomerService")
@@ -73,7 +74,7 @@ def main(client, manager_customer_id):
7374

7475
# GoogleAdsClient will read the google-ads.yaml configuration file in the
7576
# home directory if none is specified.
76-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
77+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
7778

7879
try:
7980
main(googleads_client, args.manager_customer_id)

examples/account_management/get_account_hierarchy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def print_account_hierarchy(
197197

198198
# GoogleAdsClient will read the google-ads.yaml configuration file in the
199199
# home directory if none is specified.
200-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
200+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
201201
try:
202202
main(googleads_client, args.login_customer_id)
203203
except GoogleAdsException as ex:

examples/account_management/get_change_details.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def main(client, customer_id):
196196

197197
# GoogleAdsClient will read the google-ads.yaml configuration file in the
198198
# home directory if none is specified.
199-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
199+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
200200
try:
201201
main(googleads_client, args.customer_id)
202202
except GoogleAdsException as ex:

examples/account_management/get_change_summary.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
"""This example gets a list of which resources have been changed in an account.
18-
"""
17+
"""This example gets a list of which resources have been changed in an account."""
1918

2019

2120
import argparse
@@ -98,7 +97,7 @@ def main(client, customer_id):
9897

9998
# GoogleAdsClient will read the google-ads.yaml configuration file in the
10099
# home directory if none is specified.
101-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
100+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
102101

103102
try:
104103
main(googleads_client, args.customer_id)

examples/account_management/invite_user_with_access_role.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def main(client, customer_id, email_address, access_role):
9090

9191
# GoogleAdsClient will read the google-ads.yaml configuration file in the
9292
# home directory if none is specified.
93-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
93+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
9494

9595
try:
9696
main(

examples/account_management/link_manager_to_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def main(client, customer_id, manager_customer_id):
131131

132132
# GoogleAdsClient will read the google-ads.yaml configuration file in the
133133
# home directory if none is specified.
134-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
134+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
135135
try:
136136
main(googleads_client, args.customer_id, args.manager_customer_id)
137137
except GoogleAdsException as ex:

examples/account_management/list_accessible_customers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def main(client):
4444
if __name__ == "__main__":
4545
# GoogleAdsClient will read the google-ads.yaml configuration file in the
4646
# home directory if none is specified.
47-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
47+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
4848

4949
try:
5050
main(googleads_client)

examples/account_management/update_user_access.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def modify_user_access(client, customer_id, user_id, access_role):
167167

168168
# GoogleAdsClient will read the google-ads.yaml configuration file in the
169169
# home directory if none is specified.
170-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
170+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
171171
try:
172172
main(
173173
googleads_client,

examples/account_management/verify_advertiser_identity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def start_identity_verification(client, customer_id):
144144

145145
# GoogleAdsClient will read the google-ads.yaml configuration file in the
146146
# home directory if none is specified.
147-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
147+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
148148

149149
try:
150150
main(googleads_client, args.customer_id)

examples/advanced_operations/add_ad_customizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def create_ad_with_customizations(
287287

288288
# GoogleAdsClient will read the google-ads.yaml configuration file in the
289289
# home directory if none is specified.
290-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
290+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
291291

292292
try:
293293
main(googleads_client, args.customer_id, args.ad_group_id)

examples/advanced_operations/add_ad_group_bid_modifier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def main(client, customer_id, ad_group_id, bid_modifier_value):
9292

9393
# GoogleAdsClient will read the google-ads.yaml configuration file in the
9494
# home directory if none is specified.
95-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
95+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
9696

9797
try:
9898
main(

examples/advanced_operations/add_app_campaign.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def create_ad_text_asset(client, text):
310310

311311
# GoogleAdsClient will read the google-ads.yaml configuration file in the
312312
# home directory if none is specified.
313-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
313+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
314314

315315
try:
316316
main(googleads_client, args.customer_id)

examples/advanced_operations/add_bidding_data_exclusion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def main(client, customer_id, start_date_time, end_date_time):
111111

112112
# GoogleAdsClient will read the google-ads.yaml configuration file in the
113113
# home directory if none is specified.
114-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
114+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
115115

116116
try:
117117
main(

examples/advanced_operations/add_bidding_seasonality_adjustment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def main(
133133

134134
# GoogleAdsClient will read the google-ads.yaml configuration file in the
135135
# home directory if none is specified.
136-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
136+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
137137

138138
try:
139139
main(

examples/advanced_operations/add_call_ad.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def main(
146146

147147
# GoogleAdsClient will read the google-ads.yaml configuration file in the
148148
# home directory if none is specified.
149-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
149+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
150150

151151
try:
152152
main(

examples/advanced_operations/add_display_upload_ad.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def create_display_upload_ad_group_ad(
170170

171171
# GoogleAdsClient will read the google-ads.yaml configuration file in the
172172
# home directory if none is specified.
173-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
173+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
174174

175175
try:
176176
main(googleads_client, args.customer_id, args.ad_group_id)

examples/advanced_operations/add_dynamic_page_feed_asset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def add_dsa_target(client, customer_id, ad_group_id, dsa_page_url_label):
288288

289289
# GoogleAdsClient will read the google-ads.yaml configuration file in the
290290
# home directory if none is specified.
291-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
291+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
292292

293293
try:
294294
main(

examples/advanced_operations/add_dynamic_search_ads.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def add_webpage_criterion(client, customer_id, ad_group_resource_name):
275275

276276
# GoogleAdsClient will read the google-ads.yaml configuration file in the
277277
# home directory if none is specified.
278-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
278+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
279279

280280
try:
281281
main(googleads_client, args.customer_id)

examples/advanced_operations/add_performance_max_campaign.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ def create_asset_group_signal_operations(client, customer_id, audience_id):
829829

830830
# GoogleAdsClient will read the google-ads.yaml configuration file in the
831831
# home directory if none is specified.
832-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
832+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
833833

834834
try:
835835
main(

examples/advanced_operations/add_responsive_search_ad_full.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ def add_geo_targeting(client, customer_id, campaign_resource_name):
588588

589589
# GoogleAdsClient will read the google-ads.yaml configuration file in the
590590
# home directory if none is specified.
591-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
591+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
592592

593593
try:
594594
main(

examples/advanced_operations/add_smart_campaign.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ def print_response_details(response):
872872

873873
# GoogleAdsClient will read the google-ads.yaml configuration file in the
874874
# home directory if none is specified.
875-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
875+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
876876

877877
try:
878878
main(

examples/advanced_operations/create_and_attach_shared_keyword_set.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,6 @@ def handle_googleads_exception(exception):
130130

131131
# GoogleAdsClient will read the google-ads.yaml configuration file in the
132132
# home directory if none is specified.
133-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
133+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
134134

135135
main(googleads_client, args.customer_id, args.campaign_id)

examples/advanced_operations/find_and_remove_criteria_from_shared_set.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,6 @@ def handle_googleads_exception(exception):
149149

150150
# GoogleAdsClient will read the google-ads.yaml configuration file in the
151151
# home directory if none is specified.
152-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
152+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
153153

154154
main(googleads_client, args.customer_id, args.campaign_id)

examples/advanced_operations/get_ad_group_bid_modifiers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def main(client, customer_id, ad_group_id=None):
116116

117117
# GoogleAdsClient will read the google-ads.yaml configuration file in the
118118
# home directory if none is specified.
119-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
119+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
120120

121121
try:
122122
main(

examples/advanced_operations/use_cross_account_bidding_strategy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def attach_cross_account_bidding_strategy_to_campaign(
245245

246246
# GoogleAdsClient will read the google-ads.yaml configuration file in the
247247
# home directory if none is specified.
248-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
248+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
249249

250250
try:
251251
main(

examples/advanced_operations/use_portfolio_bidding_strategy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,6 @@ def handle_googleads_exception(exception):
138138

139139
# GoogleAdsClient will read the google-ads.yaml configuration file in the
140140
# home directory if none is specified.
141-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
141+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
142142

143143
main(googleads_client, args.customer_id)

examples/assets/add_call.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def link_asset_to_account(client, customer_id, asset_resource_name):
161161

162162
# GoogleAdsClient will read the google-ads.yaml configuration file in the
163163
# home directory if none is specified.
164-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
164+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
165165

166166
try:
167167
main(

examples/assets/add_hotel_callout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def link_asset_to_account(client, customer_id, resource_names):
137137

138138
# GoogleAdsClient will read the google-ads.yaml configuration file in the
139139
# home directory if none is specified.
140-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
140+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
141141

142142
try:
143143
main(googleads_client, args.customer_id, args.language_code)

examples/assets/add_lead_form_asset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def create_lead_form_campaign_asset(
195195

196196
# GoogleAdsClient will read the google-ads.yaml configuration file in the
197197
# home directory if none is specified.
198-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
198+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
199199

200200
try:
201201
main(googleads_client, args.customer_id, args.campaign_id)

examples/assets/add_prices.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def add_asset_to_account(client, customer_id, price_asset_resource_name):
197197

198198
# GoogleAdsClient will read the google-ads.yaml configuration file in the
199199
# home directory if none is specified.
200-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
200+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
201201

202202
try:
203203
main(googleads_client, args.customer_id)

examples/assets/add_sitelinks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def link_sitelinks_to_campaign(
155155

156156
# GoogleAdsClient will read the google-ads.yaml configuration file in the
157157
# home directory if none is specified.
158-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
158+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
159159

160160
try:
161161
main(googleads_client, args.customer_id, args.campaign_id)

examples/audience_insights/generate_audience_insights.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,22 @@ def main(client, customer_id, custom_name):
4444
customer_id,
4545
location_id,
4646
user_interest_category,
47-
custom_name
47+
custom_name,
4848
)
4949
generate_suggested_targeting_insights(
5050
client,
5151
audience_insights_service,
5252
googleads_service,
5353
customer_id,
5454
location_id,
55-
custom_name
55+
custom_name,
5656
)
5757
list_audience_insights_attributes(
5858
client,
5959
audience_insights_service,
6060
customer_id,
6161
product_name,
62-
custom_name
62+
custom_name,
6363
)
6464

6565

@@ -71,7 +71,7 @@ def audience_composition_insights(
7171
customer_id,
7272
location_id,
7373
user_interest,
74-
custom_name
74+
custom_name,
7575
):
7676
"""Returns a collection of attributes represented in an audience of interest.
7777
@@ -93,8 +93,8 @@ def audience_composition_insights(
9393

9494
insights_info = client.get_type("InsightsAudienceAttributeGroup")
9595
attributes = client.get_type("AudienceInsightsAttribute")
96-
attributes.user_interest.user_interest_category = googleads_service.user_interest_path(
97-
customer_id, user_interest
96+
attributes.user_interest.user_interest_category = (
97+
googleads_service.user_interest_path(customer_id, user_interest)
9898
)
9999

100100
insights_info.attributes.append(attributes)
@@ -126,7 +126,7 @@ def generate_suggested_targeting_insights(
126126
googleads_service,
127127
customer_id,
128128
location_id,
129-
custom_name
129+
custom_name,
130130
):
131131
"""Returns a collection of targeting insights (e.g.targetable audiences)
132132
that are relevant to the requested audience.
@@ -215,7 +215,7 @@ def list_audience_insights_attributes(
215215

216216
# GoogleAdsClient will read the google-ads.yaml configuration file in the
217217
# home directory if none is specified.
218-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
218+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
219219

220220
try:
221221
main(googleads_client, args.customer_id, args.custom_name)

examples/basic_operations/add_ad_groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def main(client, customer_id, campaign_id):
6565

6666
# GoogleAdsClient will read the google-ads.yaml configuration file in the
6767
# home directory if none is specified.
68-
googleads_client = GoogleAdsClient.load_from_storage(version="v19")
68+
googleads_client = GoogleAdsClient.load_from_storage(version="v20")
6969

7070
try:
7171
main(googleads_client, args.customer_id, args.campaign_id)

0 commit comments

Comments
 (0)