TargetingIdeaService : RequestType::STATS set MatchType

已查看 43 次
跳至第一个未读帖子

vj

未读,
2017年12月15日 12:15:382017/12/15
收件人 AdWords API Forum

In old api we are use to set MatchType while getting stats using targeting idea


$keywordMatchTypeSearchParameter = new KeywordMatchTypeSearchParameter();
$keywordMatchTypeSearchParameter->keywordMatchTypes = array('BROAD');


This is my code for latest api... but I am not able to set MatchType to get stats.. could you please help me that how to do in latest api?


 $selector = new TargetingIdeaSelector();
    $selector->setRequestType(RequestType::STATS);
    $selector->setIdeaType(IdeaType::KEYWORD);
    $selector->setRequestedAttributeTypes([
    
AttributeType::KEYWORD_TEXT,AttributeType::SEARCH_VOLUME,AttributeType::AVERAGE_CPC]); $paging = new Paging(); $paging->setStartIndex(0); $paging->setNumberResults(10); $selector->setPaging($paging); foreach ($kws as $val) { $keyword = new Keyword(); $keyword->setText($val); $keyword->setMatchType(KeywordMatchType::BROAD); $keywords[] = $keyword; } $searchParameters = []; $relatedToQuerySearchParameter = new RelatedToQuerySearchParameter(); $relatedToQuerySearchParameter->setQueries($keywords); $searchParameters[] = $relatedToQuerySearchParameter;


is it removed in latest adwords apis? what is default match type used in google adwords keyword planner tool?

What is default matchtype data returns using adwords api when we are using Targetingidea service to get STATS if we dont set any matchType?


Bharani Cherukuri (AdWords API Team)

未读,
2017年12月15日 17:05:532017/12/15
收件人 AdWords API Forum
Hello, 

You may refer to this code sample on how to set the match type of a keyword using the KeywordMatchType attribute. Can you try this and let me know if you run into any issues?

Regards,
Bharani, AdWords API Team
回复全部
回复作者
转发
0 个新帖子