Skip to content

Commit fe6b852

Browse files
authored
Bug fixes for various examples. (googleads#358)
1 parent 08b28c9 commit fe6b852

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

examples/hotel_ads/add_hotel_ad.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
import google.ads.google_ads.client
2929

3030

31+
_DEFAULT_CPC_BID_CEILING_MICRO_AMOUNT = 20000000
32+
33+
3134
def main(
3235
client, customer_id, hotel_center_account_id, bid_ceiling_micro_amount
3336
):
@@ -267,8 +270,12 @@ def add_hotel_campaign(
267270
"-b",
268271
"--bid_ceiling_micro_amount",
269272
type=int,
270-
required=True,
271-
help=("The bid ceiling micro amount for " "the hotel campaign."),
273+
required=False,
274+
default=_DEFAULT_CPC_BID_CEILING_MICRO_AMOUNT,
275+
help=(
276+
"The bid ceiling micro amount for the hotel campaign. "
277+
f"The default value is {_DEFAULT_CPC_BID_CEILING_MICRO_AMOUNT}"
278+
),
272279
)
273280
parser.add_argument(
274281
"-a",

examples/hotel_ads/add_hotel_ad_group_bid_modifiers.py

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

6262
# Add the bid modifiers
6363
try:
64-
ag_bm_response = ag_bm_service.mutate_ad_groups(
64+
ag_bm_response = ag_bm_service.mutate_ad_group_bid_modifiers(
6565
customer_id, [check_in_ag_bm_operation, los_ag_bm_operation]
6666
)
6767
except google.ads.google_ads.errors.GoogleAdsException as ex:

examples/hotel_ads/add_hotel_listing_group_tree.py

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,8 @@ def _create_ad_group_criterion(
486486
required=True,
487487
help="Specify the CPC bid micro amount to be set on a created ad group "
488488
"criterion. For simplicity, each ad group criterion will use the below "
489-
"amount equally. In practice, you probably want to use different values "
490-
"for each ad group criterion.",
489+
"amount equally. In practice, you probably want to use different "
490+
"values for each ad group criterion.",
491491
)
492492
args = parser.parse_args()
493493

examples/shopping_ads/add_listing_scope.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ def main(client, customer_id, campaign_id):
5858
product_brand_dimension.product_brand.value = "google"
5959

6060
product_custom_attribute_dimension = dimensions.add()
61-
product_custom_attribute_dimension.index = client.get_type(
62-
"ProductCustomAttributeIndexEnum", version="v6"
63-
).INDEX0
64-
product_custom_attribute_dimension.value = "top_selling_products"
61+
product_custom_attribute_dimension.product_custom_attribute.index = (
62+
client.get_type("ProductCustomAttributeIndexEnum", version="v6").INDEX0
63+
)
64+
product_custom_attribute_dimension.product_custom_attribute.value = (
65+
"top_selling_products"
66+
)
6567

6668
product_type_level_enum = client.get_type(
6769
"ProductTypeLevelEnum", version="v6"

0 commit comments

Comments
 (0)