TargetingIdeaService : RequestType::STATS set MatchType

43 views
Skip to first unread message

vj

unread,
Dec 15, 2017, 12:15:38 PM12/15/17
to 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)

unread,
Dec 15, 2017, 5:05:53 PM12/15/17
to 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
Reply all
Reply to author
Forward
0 new messages