Skip to content

Commit

Permalink
Changes for release v17. (#866)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenRKarl authored Jun 6, 2024
1 parent 437d614 commit 0f0fde3
Show file tree
Hide file tree
Showing 1,549 changed files with 239,299 additions and 382 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* 24.1.0
- Google Ads API v17 release.
- Remove page_size parameter from Search requests in all examples.

* 24.0.0
- Google Ads API v16_1 release.
- Remove support for Google Ads API v14.
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 @@ -73,7 +73,7 @@ def main(client, manager_customer_id):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(googleads_client, args.manager_customer_id)
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 @@ -197,7 +197,7 @@ def print_account_hierarchy(

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")
try:
main(googleads_client, args.login_customer_id)
except GoogleAdsException as ex:
Expand Down
6 changes: 1 addition & 5 deletions examples/account_management/get_change_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
from google.ads.googleads.util import get_nested_attr


_DEFAULT_PAGE_SIZE = 1000


# [START get_change_details]
def main(client, customer_id):
"""Gets specific details about the most recent changes in the given account.
Expand Down Expand Up @@ -72,7 +69,6 @@ def main(client, customer_id):
search_request = client.get_type("SearchGoogleAdsRequest")
search_request.customer_id = customer_id
search_request.query = query
search_request.page_size = _DEFAULT_PAGE_SIZE

results = googleads_service.search(request=search_request)

Expand Down Expand Up @@ -200,7 +196,7 @@ def main(client, customer_id):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")
try:
main(googleads_client, args.customer_id)
except GoogleAdsException as ex:
Expand Down
5 changes: 1 addition & 4 deletions examples/account_management/get_change_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException

_DEFAULT_PAGE_SIZE = 1000


# [START get_change_summary]
def main(client, customer_id):
Expand All @@ -52,7 +50,6 @@ def main(client, customer_id):
search_request = client.get_type("SearchGoogleAdsRequest")
search_request.customer_id = customer_id
search_request.query = query
search_request.page_size = _DEFAULT_PAGE_SIZE

response = ads_service.search(request=search_request)

Expand Down Expand Up @@ -101,7 +98,7 @@ def main(client, customer_id):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(googleads_client, args.customer_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def main(client, customer_id, email_address, access_role):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(
Expand Down
2 changes: 1 addition & 1 deletion examples/account_management/link_manager_to_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def main(client, customer_id, manager_customer_id):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")
try:
main(googleads_client, args.customer_id, args.manager_customer_id)
except GoogleAdsException as ex:
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="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(googleads_client)
Expand Down
2 changes: 1 addition & 1 deletion examples/account_management/update_user_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def modify_user_access(client, customer_id, user_id, access_role):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")
try:
main(
googleads_client,
Expand Down
2 changes: 1 addition & 1 deletion examples/account_management/verify_advertiser_identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def start_identity_verification(client, customer_id):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(googleads_client, args.customer_id)
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced_operations/add_ad_customizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def create_ad_with_customizations(

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(googleads_client, args.customer_id, args.ad_group_id)
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced_operations/add_ad_group_bid_modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def main(client, customer_id, ad_group_id, bid_modifier_value):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced_operations/add_app_campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def create_ad_text_asset(client, text):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(googleads_client, args.customer_id)
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 @@ -111,7 +111,7 @@ def main(client, customer_id, start_date_time, end_date_time):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def 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="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced_operations/add_call_ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def 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="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(
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 @@ -170,7 +170,7 @@ def create_display_upload_ad_group_ad(

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(googleads_client, args.customer_id, args.ad_group_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def add_dsa_target(client, customer_id, ad_group_id, dsa_page_url_label):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(
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 @@ -275,7 +275,7 @@ def add_webpage_criterion(client, customer_id, ad_group_resource_name):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(googleads_client, args.customer_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ def create_asset_group_signal_operation(client, customer_id, audience_id):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(googleads_client, args.customer_id, args.audience_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ def add_geo_targeting(client, customer_id, campaign_resource_name):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced_operations/add_smart_campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ def print_response_details(response):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@ def handle_googleads_exception(exception):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

main(googleads_client, args.customer_id, args.campaign_id)
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
from google.ads.googleads.errors import GoogleAdsException


_DEFAULT_PAGE_SIZE = 10000


def main(client, customer_id, page_size, campaign_id):
def main(client, customer_id, campaign_id):
ga_service = client.get_service("GoogleAdsService")
shared_criterion_service = client.get_service("SharedCriterionService")

Expand All @@ -41,7 +38,6 @@ def main(client, customer_id, page_size, campaign_id):
shared_set_search_request = client.get_type("SearchGoogleAdsRequest")
shared_set_search_request.customer_id = customer_id
shared_set_search_request.query = shared_sets_query
shared_set_search_request.page_size = _DEFAULT_PAGE_SIZE

shared_set_response = ga_service.search(
request=shared_set_search_request
Expand Down Expand Up @@ -75,7 +71,6 @@ def main(client, customer_id, page_size, campaign_id):
)
shared_criteria_search_request.customer_id = customer_id
shared_criteria_search_request.query = shared_criteria_query
shared_criteria_search_request.page_size = _DEFAULT_PAGE_SIZE

shared_criteria_response = ga_service.search(
request=shared_criteria_search_request
Expand Down Expand Up @@ -154,8 +149,6 @@ def handle_googleads_exception(exception):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

main(
googleads_client, args.customer_id, _DEFAULT_PAGE_SIZE, args.campaign_id
)
main(googleads_client, args.customer_id, args.campaign_id)
8 changes: 2 additions & 6 deletions examples/advanced_operations/get_ad_group_bid_modifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@
from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException

_DEFAULT_PAGE_SIZE = 1000


def main(client, customer_id, page_size, ad_group_id=None):
def main(client, customer_id, ad_group_id=None):
ga_service = client.get_service("GoogleAdsService")

query = """
Expand Down Expand Up @@ -52,7 +50,6 @@ def main(client, customer_id, page_size, ad_group_id=None):
search_request = client.get_type("SearchGoogleAdsRequest")
search_request.customer_id = customer_id
search_request.query = query
search_request.page_size = _DEFAULT_PAGE_SIZE

results = ga_service.search(request=search_request)

Expand Down Expand Up @@ -119,13 +116,12 @@ def main(client, customer_id, page_size, ad_group_id=None):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(
googleads_client,
args.customer_id,
_DEFAULT_PAGE_SIZE,
ad_group_id=args.ad_group_id,
)
except GoogleAdsException as ex:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def attach_cross_account_bidding_strategy_to_campaign(

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,6 @@ def handle_googleads_exception(exception):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

main(googleads_client, args.customer_id)
2 changes: 1 addition & 1 deletion examples/assets/add_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def link_asset_to_account(client, customer_id, asset_resource_name):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(
Expand Down
2 changes: 1 addition & 1 deletion examples/assets/add_hotel_callout.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def link_asset_to_account(client, customer_id, resource_names):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(googleads_client, args.customer_id, args.language_code)
Expand Down
2 changes: 1 addition & 1 deletion examples/assets/add_lead_form_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def create_lead_form_campaign_asset(

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(googleads_client, args.customer_id, args.campaign_id)
Expand Down
2 changes: 1 addition & 1 deletion examples/assets/add_prices.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def add_asset_to_account(client, customer_id, price_asset_resource_name):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(googleads_client, args.customer_id)
Expand Down
2 changes: 1 addition & 1 deletion examples/assets/add_sitelinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def link_sitelinks_to_campaign(

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(googleads_client, args.customer_id, args.campaign_id)
Expand Down
2 changes: 1 addition & 1 deletion examples/basic_operations/add_ad_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def main(client, customer_id, campaign_id):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

try:
main(googleads_client, args.customer_id, args.campaign_id)
Expand Down
2 changes: 1 addition & 1 deletion examples/basic_operations/add_campaigns.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,6 @@ def handle_googleads_exception(exception):

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v16")
googleads_client = GoogleAdsClient.load_from_storage(version="v17")

main(googleads_client, args.customer_id)
Loading

0 comments on commit 0f0fde3

Please sign in to comment.