Skip to content

Commit

Permalink
Changes for release 11_0. (#652)
Browse files Browse the repository at this point in the history
Co-authored-by: Bob Hancock <rwh@google.com>
  • Loading branch information
bobhancock and bobhancockg authored Jun 17, 2022
1 parent fd6b65e commit 9541a75
Show file tree
Hide file tree
Showing 2,333 changed files with 216,695 additions and 7,975 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
* 17.0.0
- Google Ads API v11_0 release.
- Added example create_experiment.
- Added example detect_and_apply_recommendations
- Updated example add_smart_campaign

* 16.0.0
- Add support for fog Google Ads API v10_1.
- Remove support for Google Ads API v8.
Expand Down
19 changes: 5 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,6 @@ Documentation
Please refer to our `Developer Site`_ for documentation on how to install,
configure, and use this client library.

For Python 3.6 Users
--------------------
Version `12.0.0`_ of this library is the last version that is compatible with
Python 3.6. It contains support for `v6`_, `v7`_, and `v8`_ of the Google Ads
API. The latest API version supported by version `12.0.0`_, `v8`_, will be
supported until the Spring of 2022, so Python 3.6 users can access the Google
Ads API until then. Given that the `EOL`_ for Python 3.6 is December 23, 2021,
we encourage our users to upgrade to Python 3.7 or above as soon as possible to
avoid issues. Please follow the `Google Ads Developer Blog`_ for announcements
of the specific deprecation dates for the above API versions.

Protobuf Messages
-----------------
Version `14.0.0`_ of this library introduced the **required** `use_proto_plus`
Expand All @@ -61,6 +50,7 @@ Authors
* `Ben Karl`_
* `Andrew Burke`_
* `Laura Chevalier`_
* `Bob Hancock`_

.. |build-status| image:: https://storage.googleapis.com/gaa-clientlibs/badges/google-ads-python/buildstatus_ubuntu.svg
.. _Developer Site: https://developers.google.com/google-ads/api/docs/client-libs/python/
Expand All @@ -72,11 +62,12 @@ Authors
.. _Ben Karl: https://github.com/BenRKarl
.. _Andrew Burke: https://github.com/AndrewMBurke
.. _Laura Chevalier: https://github.com/laurachevalier4
.. _Bob Hancock: https://github.com/bobhancock
.. _12.0.0: https://pypi.org/project/google-ads/12.0.0/
.. _14.0.0: https://pypi.org/project/google-ads/14.0.0/
.. _v6: https://developers.google.com/google-ads/api/reference/rpc/v6/overview
.. _v7: https://developers.google.com/google-ads/api/reference/rpc/v7/overview
.. _v8: https://developers.google.com/google-ads/api/reference/rpc/v8/overview
.. _15.0.0: https://pypi.org/project/google-ads/15.0.0/
.. _v9: https://developers.google.com/google-ads/api/reference/rpc/v9/overview
.. _v10: https://developers.google.com/google-ads/api/reference/rpc/v10/overview
.. _EOL: https://endoflife.date/python
.. _Google Ads Developer Blog: https://ads-developers.googleblog.com/
.. _Protobuf Messages: https://developers.google.com/google-ads/api/docs/client-libs/python/protobuf-messages
6 changes: 5 additions & 1 deletion examples/advanced_operations/add_call_ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
72 changes: 50 additions & 22 deletions examples/advanced_operations/add_performance_max_campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,22 @@ def main(client, customer_id, audience_id):
#
# Create the headlines.
headline_asset_resource_names = _create_multiple_text_assets(
client, customer_id, ["Travel", "Travel Reviews", "Book travel",],
client,
customer_id,
[
"Travel",
"Travel Reviews",
"Book travel",
],
)
# Create the descriptions.
description_asset_resource_names = _create_multiple_text_assets(
client, customer_id, ["Take to the air!", "Fly to the sky!",],
client,
customer_id,
[
"Take to the air!",
"Fly to the sky!",
],
)

# The below methods create and return MutateOperations that we later
Expand All @@ -90,13 +101,18 @@ def main(client, customer_id, audience_id):
# successfully or fail entirely, leaving no orphaned entities. See:
# https://developers.google.com/google-ads/api/docs/mutating/overview
campaign_budget_operation = _create_campaign_budget_operation(
client, customer_id,
client,
customer_id,
)
performance_max_campaign_operation = _create_performance_max_campaign_operation(
client, customer_id,
performance_max_campaign_operation = (
_create_performance_max_campaign_operation(
client,
customer_id,
)
)
campaign_criterion_operations = _create_campaign_criterion_operations(
client, customer_id,
client,
customer_id,
)
asset_group_operations = _create_asset_group_operation(
client,
Expand Down Expand Up @@ -135,7 +151,8 @@ def main(client, customer_id, audience_id):

# [START add_performance_max_campaign_2]
def _create_campaign_budget_operation(
client, customer_id,
client,
customer_id,
):
"""Creates a MutateOperation that creates a new CampaignBudget.
Expand Down Expand Up @@ -173,7 +190,8 @@ def _create_campaign_budget_operation(

# [START add_performance_max_campaign_3]
def _create_performance_max_campaign_operation(
client, customer_id,
client,
customer_id,
):
"""Creates a MutateOperation that creates a new Performance Max campaign.
Expand Down Expand Up @@ -242,7 +260,8 @@ def _create_performance_max_campaign_operation(

# [START add_performance_max_campaign_4]
def _create_campaign_criterion_operations(
client, customer_id,
client,
customer_id,
):
"""Creates a list of MutateOperations that create new campaign criteria.
Expand Down Expand Up @@ -273,8 +292,8 @@ def _create_campaign_criterion_operations(
campaign_criterion.campaign = campaign_service.campaign_path(
customer_id, _PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
)
campaign_criterion.location.geo_target_constant = geo_target_constant_service.geo_target_constant_path(
"1023191"
campaign_criterion.location.geo_target_constant = (
geo_target_constant_service.geo_target_constant_path("1023191")
)
campaign_criterion.negative = False
operations.append(mutate_operation)
Expand All @@ -285,8 +304,8 @@ def _create_campaign_criterion_operations(
campaign_criterion.campaign = campaign_service.campaign_path(
customer_id, _PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
)
campaign_criterion.location.geo_target_constant = geo_target_constant_service.geo_target_constant_path(
"1022762"
campaign_criterion.location.geo_target_constant = (
geo_target_constant_service.geo_target_constant_path("1022762")
)
campaign_criterion.negative = True
operations.append(mutate_operation)
Expand All @@ -300,8 +319,8 @@ def _create_campaign_criterion_operations(
# Set the language.
# For a list of all language codes, see:
# https://developers.google.com/google-ads/api/reference/data/codes-formats#expandable-7
campaign_criterion.language.language_constant = googleads_service.language_constant_path(
"1000"
campaign_criterion.language.language_constant = (
googleads_service.language_constant_path("1000")
) # English
operations.append(mutate_operation)

Expand Down Expand Up @@ -335,7 +354,8 @@ def _create_multiple_text_assets(client, customer_id, texts):

# Send the operations in a single Mutate request.
response = googleads_service.mutate(
customer_id=customer_id, mutate_operations=operations,
customer_id=customer_id,
mutate_operations=operations,
)
asset_resource_names = []
for result in response.mutate_operation_responses:
Expand Down Expand Up @@ -383,7 +403,8 @@ def _create_asset_group_operation(
asset_group.final_mobile_urls.append("http://www.example.com")
asset_group.status = client.enums.AssetGroupStatusEnum.PAUSED
asset_group.resource_name = asset_group_service.asset_group_path(
customer_id, _ASSET_GROUP_TEMPORARY_ID,
customer_id,
_ASSET_GROUP_TEMPORARY_ID,
)
operations.append(mutate_operation)

Expand All @@ -407,7 +428,8 @@ def _create_asset_group_operation(
asset_group_asset = mutate_operation.asset_group_asset_operation.create
asset_group_asset.field_type = client.enums.AssetFieldTypeEnum.HEADLINE
asset_group_asset.asset_group = asset_group_service.asset_group_path(
customer_id, _ASSET_GROUP_TEMPORARY_ID,
customer_id,
_ASSET_GROUP_TEMPORARY_ID,
)
asset_group_asset.asset = resource_name
operations.append(mutate_operation)
Expand All @@ -420,7 +442,8 @@ def _create_asset_group_operation(
client.enums.AssetFieldTypeEnum.DESCRIPTION
)
asset_group_asset.asset_group = asset_group_service.asset_group_path(
customer_id, _ASSET_GROUP_TEMPORARY_ID,
customer_id,
_ASSET_GROUP_TEMPORARY_ID,
)
asset_group_asset.asset = resource_name
operations.append(mutate_operation)
Expand Down Expand Up @@ -508,7 +531,8 @@ def _create_and_link_text_asset(client, customer_id, text, field_type):
asset_group_asset = mutate_operation.asset_group_asset_operation.create
asset_group_asset.field_type = field_type
asset_group_asset.asset_group = asset_group_service.asset_group_path(
customer_id, _ASSET_GROUP_TEMPORARY_ID,
customer_id,
_ASSET_GROUP_TEMPORARY_ID,
)
asset_group_asset.asset = asset_service.asset_path(
customer_id, next_temp_id
Expand Down Expand Up @@ -558,7 +582,8 @@ def _create_and_link_image_asset(
asset_group_asset = mutate_operation.asset_group_asset_operation.create
asset_group_asset.field_type = field_type
asset_group_asset.asset_group = asset_group_service.asset_group_path(
customer_id, _ASSET_GROUP_TEMPORARY_ID,
customer_id,
_ASSET_GROUP_TEMPORARY_ID,
)
asset_group_asset.asset = asset_service.asset_path(
customer_id, next_temp_id
Expand Down Expand Up @@ -659,7 +684,10 @@ def _create_asset_group_signal_operation(client, customer_id, audience_id):
help="The Google Ads customer ID.",
)
parser.add_argument(
"-a", "--audience_id", type=str, help="The ID of an audience.",
"-a",
"--audience_id",
type=str,
help="The ID of an audience.",
)

args = parser.parse_args()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,11 @@ def _create_responsive_search_ad_with_customization(
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
Loading

0 comments on commit 9541a75

Please sign in to comment.