Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'FROM CRITERIA_PERFORMANCE_REPORT '
'WHERE Status IN [ENABLED, PAUSED] '
'DURING LAST_7_DAYS')
with open(path, 'w') as output_file:
report_downloader.DownloadReportWithAwql(
report_query, 'CSV', output_file, skip_report_header=False,
skip_column_header=False, skip_report_summary=False,
include_zero_impressions=True)
print 'Report was downloaded to "%s".' % path
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client, PATH)
if 'value' in ad_group_criteria:
for criterion in ad_group_criteria['value']:
if criterion['criterion']['Criterion.Type'] == 'Keyword':
print ('Ad group criterion with ad group id \'%s\' and criterion id '
'\'%s\' currently has bids:'
% (criterion['adGroupId'], criterion['criterion']['id']))
for bid in criterion['biddingStrategyConfiguration']['bids']:
print '\tType: \'%s\', value: %s' % (bid['Bids.Type'],
bid['bid']['microAmount'])
else:
print 'No ad group criteria were updated.'
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client, AD_GROUP_ID, CRITERION_ID)
'displayUrl': 'example.com',
'description1': 'Visit the Red Planet in style.',
'description2': 'Low-gravity fun for all astronauts in orbit',
'headline': 'Luxury Cruise to Mars'
}
}
}]
try:
ad_group_ad_service.mutate(operations)
except suds.WebFault, e:
print 'Validation correctly failed with \'%s\'.' % str(e)
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client, AD_GROUP_ID)
if min_est and max_est:
return (float(min_est) + float(max_est)) / 2.0
else:
return None
def _FormatMean(mean):
if mean:
return '%.2f' % mean
else:
return None
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client)
if ad_group_data['adGroupChangeStatus'] != 'NEW':
if 'changedAds' in ad_group_data:
print ' Changed ads: %s' % ad_group_data['changedAds']
if 'changedCriteria' in ad_group_data:
print (' Changed criteria: %s' %
ad_group_data['changedCriteria'])
if 'removedCriteria' in ad_group_data:
print (' Removed criteria: %s' %
ad_group_data['removedCriteria'])
else:
print 'No changes were found.'
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client)
}
}
]
ad_params = ad_param_service.mutate(operations)
# Display results.
for ad_param in ad_params:
print ('Ad parameter with text "%s" was successfully set for criterion '
'with id "%s" and ad group id "%s".'
% (ad_param['insertionText'], ad_param['criterionId'],
ad_param['adGroupId']))
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client, AD_GROUP_ID, CRITERION_ID)
# Display results.
if 'value' in ad_group_criteria:
for criterion in ad_group_criteria['value']:
if criterion['criterion']['Criterion.Type'] == 'Keyword':
print ('Ad group criterion with ad group id \'%s\' and criterion id '
'\'%s\' had its bid set to \'%s\'.'
% (criterion['adGroupId'], criterion['criterion']['id'],
criterion['bids']['maxCpc']['amount']['microAmount']))
else:
print 'No ad group criteria were updated.'
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client, AD_GROUP_ID, CRITERION_ID)
}
}]
# Create the account. It is possible to create multiple accounts with one
# request by sending an array of operations.
accounts = managed_customer_service.mutate(operations)
# Display results.
for account in accounts['value']:
print('Account with customer ID "%s" was successfully created.'
% account['customerId'])
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client)
'budgetId': budget_id
},
'advertisingChannelType': 'DISPLAY'
}
}]
campaigns = campaign_service.mutate(operations)
# Display results.
for campaign in campaigns['value']:
print ('Campaign with name \'%s\' and id \'%s\' was added.'
% (campaign['name'], campaign['id']))
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client)
operations = [{
'operator': 'ADD',
'operand': feed_item_target
}]
response = feed_item_target_service.mutate(operations)
if 'value' in response:
print ('Feed item target for feed ID "%d" and feed item ID "%d" was '
'created to restrict serving to ad group ID "%d".'
% (feed_item_target['feedId'], feed_item_target['feedItemId'],
feed_item_target['adGroupId']))
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
if AD_GROUP_ID == 'INSERT_AD_GROUP_ID_HERE':
main(adwords_client, CAMPAIGN_ID)
else:
main(adwords_client, CAMPAIGN_ID, ad_group_id=AD_GROUP_ID)