|
30 | 30 |
|
31 | 31 | def main(client, customer_id, hotel_center_account_id, |
32 | 32 | bid_ceiling_micro_amount): |
33 | | - # Add budget |
| 33 | + |
34 | 34 | budget_resource_name = add_budget(client, customer_id) |
35 | 35 |
|
36 | | - # Add hotel campaign |
| 36 | + |
37 | 37 | campaign_resource_name = add_hotel_campaign( |
38 | 38 | client, customer_id, budget_resource_name, hotel_center_account_id, |
39 | 39 | bid_ceiling_micro_amount) |
40 | 40 |
|
41 | | - # Add hotel ad group |
| 41 | + |
42 | 42 | ad_group_resource_name = add_hotel_ad_group(client, customer_id, |
43 | 43 | campaign_resource_name) |
44 | 44 |
|
45 | | - # Add hotel ad |
| 45 | + |
46 | 46 | add_hotel_ad(client, customer_id, ad_group_resource_name) |
47 | 47 |
|
48 | 48 |
|
@@ -88,8 +88,11 @@ def add_hotel_ad(client, customer_id, ad_group_resource_name): |
88 | 88 | ad_group_ad_operation = client.get_type('AdGroupAdOperation', version='v2') |
89 | 89 | ad_group_ad = ad_group_ad_operation.create |
90 | 90 | ad_group_ad.ad_group.value = ad_group_resource_name |
| 91 | + # Set the ad group ad to enabled. Setting this to paused will cause an error |
| 92 | + # for hotel campaigns. For hotels pausing should happen at either the ad group or |
| 93 | + # campaign level. |
91 | 94 | ad_group_ad.status = client.get_type('AdGroupAdStatusEnum', |
92 | | - version='v2').PAUSED |
| 95 | + version='v2').ENABLED |
93 | 96 | ad_group_ad.ad.hotel_ad.CopyFrom(client.get_type('HotelAdInfo', |
94 | 97 | version='v2')) |
95 | 98 |
|
@@ -218,7 +221,7 @@ def add_hotel_campaign(client, customer_id, budget_resource_name, |
218 | 221 | parser.add_argument('-b', '--bid_ceiling_micro_amount', type=int, |
219 | 222 | required=True, help=('The bid ceiling micro amount for ' |
220 | 223 | 'the hotel campaign.')) |
221 | | - parser.add_argument('-h', '--hotel_center_account_id', type=str, |
| 224 | + parser.add_argument('-a', '--hotel_center_account_id', type=int, |
222 | 225 | required=True, help='The hotel center account ID.') |
223 | 226 | args = parser.parse_args() |
224 | 227 |
|
|
0 commit comments