Created
February 29, 2020 18:41
-
-
Save limata3/379ea65bb9e6458d32963e8eea9965bb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_draft(): | |
adwords_client = connect_to_adwords_api() | |
draft_service = adwords_client.GetService('DraftService', version='v201809') | |
draft = { | |
'baseCampaignId': original_campaign_id, | |
'draftName': {draft_name} | |
} | |
draft_operation = {'operator': 'ADD', 'operand': draft} | |
draft = draft_service.mutate([draft_operation])['value'][0] | |
draft_campaign_id = draft['draftCampaignId'] | |
draft_id = draft['draftId'] | |
return draft_id, draft_campaign_id | |
# You may want to consider the draft name to be the original campaign name plus a common identifier of all of the drafts that will be included in this test, such as: | |
# draft_name = '{0}-Test_XYZ'.format({original_campaign_name}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment