google adwords api:如何获取关键字/广告中的adgroupId?
根据谷歌网站上的代码示例,我能够获取关键字和广告。该示例打印如下内容:
printf("Text ad with headline '%s' and id '%s' was found.\n", $googleAd->ad->headline, $googleAd->ad->id);
基于获取的此类字段列表:
$selector->fields = array('Headline', 'Id')
是否也可以获得 adGroupId?我一直在查看TextAd 文档,但是我在字段列表中看不到 adGroupId。恐怕这是不可能的,因为广告组 有一个名为campaignId 的字段。有什么帮助吗?
Based on code examples on google website I am able to fetch keywords and ads. The example prints something like this:
printf("Text ad with headline '%s' and id '%s' was found.\n", $googleAd->ad->headline, $googleAd->ad->id);
based on such field list which was fetched:
$selector->fields = array('Headline', 'Id')
Is it possible to get adGroupId as well ? I have been looking at documentation for TextAd, however I cannot see adGroupId in field list. I am afraid it is not possible, because adgroup has field called campaignId. Any help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,可以获取广告组 ID。它是 AdGroupAd 类型的一部分,可以使用“AdGroupId”作为选择器名称来检索。然后,您将检索该字段为 $googleAd->adGroupId。更多详情请参见:
http://code.google.com /apis/adwords/docs/reference/latest/AdGroupAdService.AdGroupAd.html
今后,我建议您在官方 AdWords API 论坛上提问:http://code.google.com/apis/adwords/community/。该论坛非常活跃,AdWords API 团队成员定期在论坛上回答开发人员的问题。
Yes, it is possible to get adgroup id. It is part of AdGroupAd type, and can be retrieved using "AdGroupId" as selector name. Then you would retrieve the field as $googleAd->adGroupId. More details here:
http://code.google.com/apis/adwords/docs/reference/latest/AdGroupAdService.AdGroupAd.html
In the future, I recommend that you ask the questions on the official AdWords API forum at http://code.google.com/apis/adwords/community/. The forum is pretty active, and AdWords API team members regularly answer developer questions on the forum.