[英]What "operations" do I use to get keyword search volume from the googleads api? (TargetingIdeaService)
I am trying to get a search volume metric from the Google Ads API.我正在尝试从 Google Ads API 获取搜索量指标。 I am running into trouble when I using the "SearchVolumeSearchParameter" argument.
我在使用“SearchVolumeSearchParameter”参数时遇到了麻烦。 This argument requires an "operation" field and the documentation does not do a great job on explaining what these operations can be.
这个论点需要一个“操作”字段,文档并没有很好地解释这些操作可以是什么。 Preferably, I would like the script to return a list of keywords and their respective search volumes for the previous month.
最好,我希望脚本返回上个月的关键字列表及其各自的搜索量。
adwords_client = adwords.AdWordsClient.LoadFromStorage()
targeting_idea_service = adwords_client.GetService(
'TargetingIdeaService', version='v201809')
selector = {
'ideaType': 'KEYWORD',
'requestType': 'STATS'
}
selector['requestedAttributeTypes'] = [
'KEYWORD_TEXT',
'SEARCH_VOLUME',
# 'TARGETED_MONTHLY_SEARCHES',
]
offset = 0
PAGE_SIZE = 500
selector['paging'] = {
'startIndex': str(offset),
'numberResults': str(PAGE_SIZE)
}
selector['searchParameters'] = [{
'xsi_type': 'SearchVolumeSearchParameter',
'operation': []
}]
page = targeting_idea_service.get(selector)
You use maximum, minimum like so:您使用最大值、最小值,如下所示:
selector['searchParameters'] = [
{
'xsi_type': 'RelatedToQuerySearchParameter',
'queries': search_keywords
},
{
'xsi_type': 'LocationSearchParameter',
'locations': [
{'id': location_id}
]
},
{
'xsi_type': 'SearchVolumeSearchParameter',
'operation': [
{'minimum': 100}
]
}
]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.