And if I add following code for bidding strategy and run:
campaign_bid_strategy_service = ga_client.get_service('BiddingStrategyService',
version='v2')
campaign_bid_strategy_operation =
ga_client.get_type('BiddingStrategyOperation', version='v2')
campaign_bid_strategy = campaign_bid_strategy_operation.create
campaign_bid_strategy.name.value = 'Test bid'
campaign_bid_strategy.type =
ga_client.get_type('BiddingStrategyTypeEnum').TARGET_CPA
campaign_bid_strategy.target_cpa.target_cpa_micros.value = 50000
# Add bid.
try:
campaign_bid_strategy_response = (
campaign_bid_strategy_service.mutate_bidding_strategies(
test_id, [campaign_bid_strategy_operation]))
except google.ads.google_ads.errors.GoogleAdsException as ex:
print('Request with ID "%s" failed with status "%s" and includes the '
'following errors:' % (ex.request_id, ex.error.code().name))
for error in ex.failure.errors:
print('\tError with message "%s".' % error.message)
if error.location:
for field_path_element in error.location.field_path_elements:
print('\t\tOn field: %s' % field_path_element.field_name)
sys.exit(1)
campaign.bidding_strategy.value =
(campaign_bid_strategy_response.results[0].resource_name)
I’ve got another error:
{
error_code {
operation_access_denied_error: OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE
}
message: "This operation is not permitted on this campaign type"
trigger {
string_value: ""
}
location {
field_path_elements {
field_name: "operations"
index {
}
}
field_path_elements {
field_name: "create"
}
field_path_elements {
field_name: "bidding_strategy"
}
}
}
I understand that I’ve created portfolio bidding strategy, and I cannot use
it with an app campaign, however I don’t know how to create simple bidding
strategy.
Thanks!
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/0b7d42fb-41f4-479b-9c28-4aa356099971%40googlegroups.com.