Skip to content

Commit

Permalink
Changes for release v15_0.
Browse files Browse the repository at this point in the history
  • Loading branch information
BenRKarl committed Oct 19, 2023
1 parent eb2b981 commit 310a10b
Show file tree
Hide file tree
Showing 1,522 changed files with 232,523 additions and 525 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
* 22.1.0
- Google Ads API v15 release.
- Add configuration option allowing developer token to be ignored.
- Make "impersonation_email" an optional configuration for service accounts.
- Redact PII fields from new LocalServicesLead and LocalServicesLeadConversation in logs.
- Add DMA consent to conversions and Customer Match examples.
- Update enhanced conversions examples to fit with for-leads and for-web workflows.
- Update usage of ProductBiddingCategoryConstant to ProductCategoryConstant in examples.

* 22.0.0
- Remove support for Google Ads API v12.

Expand Down
5 changes: 5 additions & 0 deletions examples/account_management/approve_merchant_center_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
To run this code example, you must use the Merchant Center UI or the Content
API for Shopping to send a link request between your Merchant Center and Google
Ads accounts.
NOTE: This code example uses version v14 of the Google Ads API. Version v15 of
the Google Ads API replaces MerchantCenterLinkService with
ProductLinkInvitationService and ProductLinkService. We will add new code
examples using these services shortly.
"""

import argparse
Expand Down
2 changes: 1 addition & 1 deletion examples/account_management/create_customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def main(client, manager_customer_id):
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v14")
googleads_client = GoogleAdsClient.load_from_storage(version="v15")

parser = argparse.ArgumentParser(
description=("Creates a new client under the given manager.")
Expand Down
2 changes: 1 addition & 1 deletion examples/account_management/get_account_hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def print_account_hierarchy(
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v14")
googleads_client = GoogleAdsClient.load_from_storage(version="v15")

parser = argparse.ArgumentParser(
description="This example gets the account hierarchy of the specified "
Expand Down
2 changes: 1 addition & 1 deletion examples/account_management/get_change_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def main(client, customer_id):
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v14")
googleads_client = GoogleAdsClient.load_from_storage(version="v15")

parser = argparse.ArgumentParser(
description="This example gets specific details about the most recent "
Expand Down
2 changes: 1 addition & 1 deletion examples/account_management/get_change_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def main(client, customer_id):
if __name__ == "__main__":
# GoogleAdsClient will read a google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v14")
googleads_client = GoogleAdsClient.load_from_storage(version="v15")

parser = argparse.ArgumentParser(
description=(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def main(client, customer_id, email_address, access_role):
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v14")
googleads_client = GoogleAdsClient.load_from_storage(version="v15")

parser = argparse.ArgumentParser(
description=(
Expand Down
10 changes: 7 additions & 3 deletions examples/account_management/link_manager_to_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ def main(client, customer_id, manager_customer_id):
)
manager_link_operation = client.get_type("CustomerManagerLinkOperation")
manager_link = manager_link_operation.update
manager_link.resource_name = customer_manager_link_service.customer_manager_link_path(
customer_id, manager_customer_id, manager_link_id,
manager_link.resource_name = (
customer_manager_link_service.customer_manager_link_path(
customer_id,
manager_customer_id,
manager_link_id,
)
)

manager_link.status = client.enums.ManagerLinkStatusEnum.ACTIVE
Expand All @@ -108,7 +112,7 @@ def main(client, customer_id, manager_customer_id):
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v14")
googleads_client = GoogleAdsClient.load_from_storage(version="v15")

parser = argparse.ArgumentParser(
description=(
Expand Down
2 changes: 1 addition & 1 deletion examples/account_management/list_accessible_customers.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def main(client):
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v14")
googleads_client = GoogleAdsClient.load_from_storage(version="v15")

try:
main(googleads_client)
Expand Down
11 changes: 9 additions & 2 deletions examples/account_management/reject_merchant_center_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
Shopping to send a link request between your Merchant Center and Google Ads
accounts. You can find detailed instructions to link your Merchant Center and
Google Ads accounts here: https://support.google.com/merchants/answer/6159060.
NOTE: This code example uses version v14 of the Google Ads API. Version v15 of
the Google Ads API replaces MerchantCenterLinkService with
ProductLinkInvitationService and ProductLinkService. We will add new code
examples using these services shortly.
"""

import argparse
Expand All @@ -45,8 +50,10 @@ def main(client, customer_id, merchant_center_account_id):
"MerchantCenterLinkService"
)
# Get the extant customer account to Merchant Center account links.
list_merchant_center_links_response = merchant_center_link_service.list_merchant_center_links(
customer_id=customer_id
list_merchant_center_links_response = (
merchant_center_link_service.list_merchant_center_links(
customer_id=customer_id
)
)

number_of_links = len(
Expand Down
8 changes: 5 additions & 3 deletions examples/account_management/update_user_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ def modify_user_access(client, customer_id, user_id, access_role):
customer_user_access_op = client.get_type("CustomerUserAccessOperation")
access_role_enum = client.enums.AccessRoleEnum
customer_user_access = customer_user_access_op.update
customer_user_access.resource_name = customer_user_access_service.customer_user_access_path(
customer_id, user_id
customer_user_access.resource_name = (
customer_user_access_service.customer_user_access_path(
customer_id, user_id
)
)
customer_user_access.access_role = getattr(access_role_enum, access_role)
client.copy_from(
Expand All @@ -135,7 +137,7 @@ def modify_user_access(client, customer_id, user_id, access_role):
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v14")
googleads_client = GoogleAdsClient.load_from_storage(version="v15")

parser = argparse.ArgumentParser(
description="This code example updates the access role of a user, "
Expand Down
8 changes: 6 additions & 2 deletions examples/advanced_operations/add_ad_customizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def create_ad_with_customizations(
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v14")
googleads_client = GoogleAdsClient.load_from_storage(version="v15")

parser = argparse.ArgumentParser(
description=(
Expand All @@ -281,7 +281,11 @@ def create_ad_with_customizations(
help="The Google Ads customer ID.",
)
parser.add_argument(
"-a", "--ad_group_id", type=str, required=True, help="An ad group ID.",
"-a",
"--ad_group_id",
type=str,
required=True,
help="An ad group ID.",
)
args = parser.parse_args()

Expand Down
5 changes: 3 additions & 2 deletions examples/advanced_operations/add_ad_group_bid_modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def main(client, customer_id, ad_group_id, bid_modifier_value):

# Add the ad group bid modifier.
ad_group_bm_response = ad_group_bm_service.mutate_ad_group_bid_modifiers(
customer_id=customer_id, operations=[ad_group_bid_modifier_operation],
customer_id=customer_id,
operations=[ad_group_bid_modifier_operation],
)
# [END add_ad_group_bid_modifier]

Expand All @@ -64,7 +65,7 @@ def main(client, customer_id, ad_group_id, bid_modifier_value):
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v14")
googleads_client = GoogleAdsClient.load_from_storage(version="v15")

parser = argparse.ArgumentParser(
description=(
Expand Down
10 changes: 5 additions & 5 deletions examples/advanced_operations/add_app_campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ def set_campaign_targeting_criteria(
)
campaign_criterion = campaign_criterion_operation.create
campaign_criterion.campaign = campaign_resource_name
campaign_criterion.location.geo_target_constant = geo_target_constant_service.geo_target_constant_path(
location_id
campaign_criterion.location.geo_target_constant = (
geo_target_constant_service.geo_target_constant_path(location_id)
)
campaign_criterion_operations.append(campaign_criterion_operation)

Expand All @@ -195,8 +195,8 @@ def set_campaign_targeting_criteria(
)
campaign_criterion = campaign_criterion_operation.create
campaign_criterion.campaign = campaign_resource_name
campaign_criterion.language.language_constant = googleads_service.language_constant_path(
language_id
campaign_criterion.language.language_constant = (
googleads_service.language_constant_path(language_id)
)
campaign_criterion_operations.append(campaign_criterion_operation)

Expand Down Expand Up @@ -295,7 +295,7 @@ def create_ad_text_asset(client, text):
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v14")
googleads_client = GoogleAdsClient.load_from_storage(version="v15")

parser = argparse.ArgumentParser(
description=(
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced_operations/add_bidding_data_exclusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def main(client, customer_id, start_date_time, end_date_time):
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v14")
googleads_client = GoogleAdsClient.load_from_storage(version="v15")

parser = argparse.ArgumentParser(
description="Adds a data exclusion for conversions in Smart Bidding "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def main(
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v14")
googleads_client = GoogleAdsClient.load_from_storage(version="v15")

parser = argparse.ArgumentParser(
description="Adds a seasonality adjustment for conversions in Smart "
Expand Down
8 changes: 6 additions & 2 deletions examples/advanced_operations/add_call_ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def main(
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v14")
googleads_client = GoogleAdsClient.load_from_storage(version="v15")

parser = argparse.ArgumentParser(
description=("Adds a call extension to a specific account.")
Expand All @@ -115,7 +115,11 @@ def main(
help="The Google Ads customer ID.",
)
parser.add_argument(
"-a", "--ad_group_id", type=str, required=True, help="An ad group ID.",
"-a",
"--ad_group_id",
type=str,
required=True,
help="An ad group ID.",
)
parser.add_argument(
"-n",
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced_operations/add_display_upload_ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def create_display_upload_ad_group_ad(
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v14")
googleads_client = GoogleAdsClient.load_from_storage(version="v15")

parser = argparse.ArgumentParser(
description="Adds a display upload ad to a given ad group."
Expand Down
10 changes: 6 additions & 4 deletions examples/advanced_operations/add_dynamic_page_feed_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,13 @@ def add_dsa_target(client, customer_id, ad_group_id, dsa_page_url_label):
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v14")
googleads_client = GoogleAdsClient.load_from_storage(version="v15")

parser = argparse.ArgumentParser(description=(
"Adds a page feed with URLs for a Dynamic Search Ads campaign"
))
parser = argparse.ArgumentParser(
description=(
"Adds a page feed with URLs for a Dynamic Search Ads campaign"
)
)
# The following argument(s) should be provided to run the example.
parser.add_argument(
"-c",
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced_operations/add_dynamic_search_ads.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def add_webpage_criterion(client, customer_id, ad_group_resource_name):
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v14")
googleads_client = GoogleAdsClient.load_from_storage(version="v15")

parser = argparse.ArgumentParser(
description=(
Expand Down
Loading

0 comments on commit 310a10b

Please sign in to comment.