-
Notifications
You must be signed in to change notification settings - Fork 509
add add_campaign_draft.py code example #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""This example adds a campaign draft for a campaign. | ||
Make sure you specify a campaign that has a non-shared budget. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: leave a blank line between "This..." and "Make..."
import sys | ||
from uuid import uuid4 | ||
|
||
import google.ads.google_ads.client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace by
from google.ads.google_ads.client import GoogleAdsClient
|
||
|
||
def main(client, customer_id, base_campaign_id): | ||
campaign_service = client.get_service('CampaignService',version='v3') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: space required between 'CampaignService', version='v3'
print(f'\t\tOn field: {field_path_element.field_name}') | ||
sys.exit(1) | ||
|
||
print(f'Created campaign draft: ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: does not need an f-string since there is no substitution
sys.exit(1) | ||
|
||
print(f'Created campaign draft: ' | ||
f'{campaign_draft_response.results[0].resource_name}.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enclose resulting resource name in quotes, ie.
f'"{campaign_draft_response.results[0].resource_name}".')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approve pending David's comment.
Addressed David's comments. PTAL. thx |
add add_campaign_draft.py code example