Hi Eric, thanks for your response,
My remaining issue seems to be the one regarding the use of the
NgramGroupsSearchParameter (v200909), in order to exclude synonyms
from the results :-
string[] keywords = new string[1];
keywords[0] = "diet coke";
v200909.NgramGroupsSearchParameter
ngramGroupsSearchParameter = new v200909.NgramGroupsSearchParameter();
if (!_getSynonyms)
{
ngramGroupsSearchParameter.ngramGroups =
keywords;
selector.searchParameters = new
v200909.SearchParameter[] { relatedToKeywordSearchParameter,
keywordMatchTypeSearchParameter, countryTargetSearchParameter,
languageTargetSearchParameter, ngramGroupsSearchParameter };
}
As I stated earlier, originally the behaviour seemed to be that
(taking my diet coke example), if I used the code snippet above to
exclude synonyms, then I would get more than one result, results like
"diet coke", "diet coke with lime", "calories in diet coke" etc etc.
Now I always receive one result ("diet coke"). Which behaviour should
I expect?
And here are the SOAP requests and responses:-
-----------------BEGIN API CALL---------------------
Request
-------
POST /api/adwords/o/v200909/TargetingIdeaService
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client
Protocol 2.0.50727.4952)
VsDebuggerCausalityData: uIDPo9pCoBjkQbVAu+r20/
GRKwkAAAAAfdsxqmcxXkaXn7U6Y2/oAYBGtgDAdGxKsHjqjTyQFNYACQAA
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Host: adwords.google.com
Content-Length: 2337
Expect: 100-continue
Accept-Encoding: gzip
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/
XMLSchema"><soap:Header><RequestHeader xmlns="https://
adwords.google.com/api/adwords/o/v200909"><applicationToken
xmlns="https://adwords.google.com/api/adwords/cm/
v200909">********mqyQ</applicationToken><authToken xmlns="https://
adwords.google.com/api/adwords/cm/v200909">********</
authToken><developerToken xmlns="https://adwords.google.com/api/
adwords/cm/v200909">********pb-Q</developerToken></RequestHeader></
soap:Header><soap:Body><get xmlns="https://adwords.google.com/api/
adwords/o/v200909"><selector><searchParameters
xsi:type="RelatedToKeywordSearchParameter"><keywords><text
xmlns="https://adwords.google.com/api/adwords/cm/v200909">diet coke</
text><matchType xmlns="https://adwords.google.com/api/adwords/cm/
v200909">EXACT</matchType></keywords></
searchParameters><searchParameters
xsi:type="KeywordMatchTypeSearchParameter"><keywordMatchTypes>EXACT</
keywordMatchTypes></searchParameters><searchParameters
xsi:type="CountryTargetSearchParameter"><countryTargets><countryCode
xmlns="https://adwords.google.com/api/adwords/cm/v200909">GB</
countryCode></countryTargets></searchParameters><searchParameters
xsi:type="LanguageTargetSearchParameter"><languageTargets><languageCode
xmlns="https://adwords.google.com/api/adwords/cm/v200909">en</
languageCode></languageTargets></searchParameters><searchParameters
xsi:type="NgramGroupsSearchParameter"><ngramGroups>diet coke</
ngramGroups></searchParameters><ideaType>KEYWORD</
ideaType><requestType>IDEAS</
requestType><requestedAttributeTypes>KEYWORD</
requestedAttributeTypes><requestedAttributeTypes>AVERAGE_TARGETED_MONTHLY_SEARCHES</
requestedAttributeTypes><requestedAttributeTypes>TARGETED_MONTHLY_SEARCHES</
requestedAttributeTypes><paging><startIndex xmlns="https://
adwords.google.com/api/adwords/cm/v200909">0</
startIndex><numberResults xmlns="https://adwords.google.com/api/
adwords/cm/v200909">20</numberResults></paging></selector></get></
soap:Body></soap:Envelope>
Response
--------
SOAPAction: ""
Content-Encoding:
Transfer-Encoding: chunked
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=UTF-8
Date: Mon, 11 Oct 2010 14:52:34 GMT
Expires: Mon, 11 Oct 2010 14:52:34 GMT
Server: GSE
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/
envelope/"><soap:Header><ns2:ResponseHeader xmlns:ns2="https://
adwords.google.com/api/adwords/o/v200909" xmlns="https://
adwords.google.com/api/adwords/cm/
v200909"><requestId>3e4937d1e4da5cc3f674863843a99930</
requestId><operations>1</operations><responseTime>455</
responseTime><units>6</units></ns2:ResponseHeader></
soap:Header><soap:Body><ns2:getResponse xmlns="https://
adwords.google.com/api/adwords/cm/v200909" xmlns:ns2="https://
adwords.google.com/api/adwords/o/
v200909"><ns2:rval><ns2:totalNumEntries>1</
ns2:totalNumEntries><ns2:entries><ns2:data><ns2:key>TARGETED_MONTHLY_SEARCHES</
ns2:key><ns2:value xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"
xsi:type="ns2:MonthlySearchVolumeAttribute"><ns2:Attribute.Type>MonthlySearchVolumeAttribute</
ns2:Attribute.Type><ns2:value><ns2:year>2010</ns2:year><ns2:month>9</
ns2:month></ns2:value><ns2:value><ns2:year>2010</
ns2:year><ns2:month>8</ns2:month><ns2:count>1600</ns2:count></
ns2:value><ns2:value><ns2:year>2010</ns2:year><ns2:month>7</
ns2:month><ns2:count>1900</ns2:count></
ns2:value><ns2:value><ns2:year>2010</ns2:year><ns2:month>6</
ns2:month><ns2:count>1900</ns2:count></
ns2:value><ns2:value><ns2:year>2010</ns2:year><ns2:month>5</
ns2:month><ns2:count>2400</ns2:count></
ns2:value><ns2:value><ns2:year>2010</ns2:year><ns2:month>4</
ns2:month><ns2:count>2400</ns2:count></
ns2:value><ns2:value><ns2:year>2010</ns2:year><ns2:month>3</
ns2:month><ns2:count>2900</ns2:count></
ns2:value><ns2:value><ns2:year>2010</ns2:year><ns2:month>2</
ns2:month><ns2:count>1300</ns2:count></
ns2:value><ns2:value><ns2:year>2010</ns2:year><ns2:month>1</
ns2:month><ns2:count>1300</ns2:count></
ns2:value><ns2:value><ns2:year>2009</ns2:year><ns2:month>12</
ns2:month><ns2:count>1000</ns2:count></
ns2:value><ns2:value><ns2:year>2009</ns2:year><ns2:month>11</
ns2:month><ns2:count>1600</ns2:count></
ns2:value><ns2:value><ns2:year>2009</ns2:year><ns2:month>10</
ns2:month><ns2:count>1600</ns2:count></ns2:value></ns2:value></
ns2:data><ns2:data><ns2:key>KEYWORD</ns2:key><ns2:value
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="ns2:KeywordAttribute"><ns2:Attribute.Type>KeywordAttribute</
ns2:Attribute.Type><ns2:value><Criterion.Type>Keyword</
Criterion.Type><text>diet coke</text><matchType>EXACT</matchType></
ns2:value></ns2:value></
ns2:data><ns2:data><ns2:key>AVERAGE_TARGETED_MONTHLY_SEARCHES</
ns2:key><ns2:value xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"
xsi:type="ns2:LongAttribute"><ns2:Attribute.Type>LongAttribute</
ns2:Attribute.Type><ns2:value>1900</ns2:value></ns2:value></ns2:data></
ns2:entries></ns2:rval></ns2:getResponse></soap:Body></soap:Envelope>
-----------------END API CALL-----------------------
-----------------BEGIN API CALL---------------------
Request
-------
POST /api/adwords/o/v200909/TargetingIdeaService
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client
Protocol 2.0.50727.4952)
VsDebuggerCausalityData: uIDPo9tCoBjkQbVAu+r20/
GRKwkAAAAAfdsxqmcxXkaXn7U6Y2/oAYBGtgDAdGxKsHjqjTyQFNYACQAA
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Host: adwords.google.com
Content-Length: 2338
Expect: 100-continue
Accept-Encoding: gzip
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/
XMLSchema"><soap:Header><RequestHeader xmlns="https://
adwords.google.com/api/adwords/o/v200909"><applicationToken
xmlns="https://adwords.google.com/api/adwords/cm/
v200909">********mqyQ</applicationToken><authToken xmlns="https://
adwords.google.com/api/adwords/cm/v200909">********</
authToken><developerToken xmlns="https://adwords.google.com/api/
adwords/cm/v200909">********pb-Q</developerToken></RequestHeader></
soap:Header><soap:Body><get xmlns="https://adwords.google.com/api/
adwords/o/v200909"><selector><searchParameters
xsi:type="RelatedToKeywordSearchParameter"><keywords><text
xmlns="https://adwords.google.com/api/adwords/cm/v200909">diet coke</
text><matchType xmlns="https://adwords.google.com/api/adwords/cm/
v200909">EXACT</matchType></keywords></
searchParameters><searchParameters
xsi:type="KeywordMatchTypeSearchParameter"><keywordMatchTypes>EXACT</
keywordMatchTypes></searchParameters><searchParameters
xsi:type="CountryTargetSearchParameter"><countryTargets><countryCode
xmlns="https://adwords.google.com/api/adwords/cm/v200909">GB</
countryCode></countryTargets></searchParameters><searchParameters
xsi:type="LanguageTargetSearchParameter"><languageTargets><languageCode
xmlns="https://adwords.google.com/api/adwords/cm/v200909">en</
languageCode></languageTargets></searchParameters><searchParameters
xsi:type="NgramGroupsSearchParameter"><ngramGroups>diet coke</
ngramGroups></searchParameters><ideaType>KEYWORD</
ideaType><requestType>IDEAS</
requestType><requestedAttributeTypes>KEYWORD</
requestedAttributeTypes><requestedAttributeTypes>AVERAGE_TARGETED_MONTHLY_SEARCHES</
requestedAttributeTypes><requestedAttributeTypes>TARGETED_MONTHLY_SEARCHES</
requestedAttributeTypes><paging><startIndex xmlns="https://
adwords.google.com/api/adwords/cm/v200909">20</
startIndex><numberResults xmlns="https://adwords.google.com/api/
adwords/cm/v200909">20</numberResults></paging></selector></get></
soap:Body></soap:Envelope>
Response
--------
SOAPAction: ""
Content-Encoding:
Transfer-Encoding: chunked
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=UTF-8
Date: Mon, 11 Oct 2010 14:52:35 GMT
Expires: Mon, 11 Oct 2010 14:52:35 GMT
Server: GSE
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/
envelope/"><soap:Header><ResponseHeader xmlns:ns2="https://
adwords.google.com/api/adwords/cm/v200909" xmlns="https://
adwords.google.com/api/adwords/o/
v200909"><ns2:requestId>06d9d496714e5cbc31e4a3ff26ad6f56</
ns2:requestId><ns2:operations>1</ns2:operations><ns2:responseTime>82</
ns2:responseTime><ns2:units>6</ns2:units></ResponseHeader></
soap:Header><soap:Body><getResponse xmlns="https://adwords.google.com/
api/adwords/o/v200909" xmlns:ns2="https://adwords.google.com/api/
adwords/cm/v200909"><rval><totalNumEntries>1</totalNumEntries></rval></
getResponse></soap:Body></soap:Envelope>
-----------------END API CALL-----------------------
Thanks for your help,
Serge.
On Oct 7, 6:58 pm, AdWords API Advisor <[email protected]>
wrote:
> Hi,
>
> The problem with the KeywordMatchTypeSearchParameter has been resolved
> and you should now see the correct behavior when using this
> parameter. Starting in v201003 the NgramGroupsSearchParameter was
> replaced by the IdeaTextMatchesSearchParameter:
>
> http://code.google.com/apis/adwords/docs/reference/latest/TargetingId...
>
> In regards to the other behavior, can you post the sanitized SOAP XML
> request and response that demonstrates the problem?
>
> Best,
> - Eric Koleda, AdWords API Team
>
> On Oct 6, 7:09 am, Serge_Lapin <[email protected]>
> wrote:
>
>
>
> > Hello,
>
> > I have recently completed the development of an internal tool
> > (using version 8.0.0 of the .NET client library and the v200909
> > classes). The tool takes in keyword(s), language, country and match
> > type (broad, exact or phrase), and displays the results to the user.
> > Initially (about a month ago), the search volumes returned were vastly
> > inflated from those given by the new Google Keyword Tool, but, after
> > scratching my head and ultimately making ZERO changes to my code, all
> > of a sudden the numbers started matching (= happy customer). Then,
> > about a week ago, it was noticed that NO results were being returned.
> > I confirmed that my code had not changed at all. A couple of days
> > later, results started to be returned again, but:-
>
> > a) The match type is being ignored, i.e if "Exact" is specified,
> > "Broad" and "Phrase" are also returned.
>
> > b) If, for example the phrase supplied is "diet coke", now only 1
> > result is returned (actually 3 because of the problem described in (a)
> > above), which is "diet coke". Previously I'm sure that it was
> > returning multiple results of keywords e.g. "calories in diet coke",
> > "diet coke with lime" etc. I had achieved this behaviour by using the
> > NgramGroupsSearchParameter in order to ignore synonyms. Again the
> > behaviour seems to have changed.
>
> > So now I'm a little confused as to what is happening. I decided to try
> > version 10.0.0 of the client library, but v201008 doesn't appear to
> > have the NgramGroupsSearchParameter, in which case how does one
> > specify to the API that synonyms should be ignored?
>
> > As I previously stated, my code has not changed throughout these
> > behaviour changes, but here is the relevant code anyway. Please let me
> > know if you require any further information.
>
> > _currentKeyword = _seedKeywords[0];
>
> > //Set the Google Match Type
> > v200909.KeywordMatchType googleMatchType;
> > switch (_matchType)
> > {
> > case KeywordsMatchTypes.Broad:
> > googleMatchType =
> > v200909.KeywordMatchType.BROAD;
> > break;
> > case KeywordsMatchTypes.Exact:
> > googleMatchType =
> > v200909.KeywordMatchType.EXACT;
> > break;
> > case KeywordsMatchTypes.Phrase:
> > googleMatchType =
> > v200909.KeywordMatchType.PHRASE;
> > break;
> > default:
> > googleMatchType =
> > v200909.KeywordMatchType.EXACT;
> > break;
> > }
>
> > // Create KeywordRequests.
> > string[] keywords =
> > Regex.Split(_currentKeyword.Keywords, "\r\n");
> > v200909.Keyword[] adwordsKeywords = new
> > v200909.Keyword[keywords.GetUpperBound(0)+1];
> > int kwIndex = -1;
> > foreach (string keyword in keywords)
> > {
> > kwIndex++;
> > adwordsKeywords[kwIndex] = new
> > v200909.Keyword();
> > adwordsKeywords[kwIndex].text = keyword;
> > adwordsKeywords[kwIndex].matchType =
> > googleMatchType;
> > adwordsKeywords[kwIndex].matchTypeSpecified =
> > true;
> > }
>
> > // Create selector.
> > v200909.TargetingIdeaSelector selector = new
> > v200909.TargetingIdeaSelector();
> > selector.requestType = v200909.RequestType.IDEAS;
> > selector.requestTypeSpecified = true;
> > selector.ideaType = v200909.IdeaType.KEYWORD;
> > selector.ideaTypeSpecified = true;
> > selector.requestedAttributeTypes = new
> > v200909.AttributeType[] { v200909.AttributeType.KEYWORD,
>
> > v200909.AttributeType.AVERAGE_TARGETED_MONTHLY_SEARCHES,
>
> > v200909.AttributeType.TARGETED_MONTHLY_SEARCHES};
>
> > // Set selector paging (required for targeting
> > idea service).
> > v200909.Paging paging = new v200909.Paging();
> > paging.startIndex = 0;
> > paging.startIndexSpecified = true;
> > paging.numberResults =
> > targetingIdeaPage_numberResultsPerPage;
> > paging.numberResultsSpecified = true;
> > selector.paging = paging;
>
> > // Create related to keyword search parameter.
> > v200909.RelatedToKeywordSearchParameter
> > relatedToKeywordSearchParameter = new
> > v200909.RelatedToKeywordSearchParameter();
> > relatedToKeywordSearchParameter.keywords =
> > adwordsKeywords;
>
> > // Create keyword match type search parameter to
> > ensure unique results.
> > v200909.KeywordMatchTypeSearchParameter
> > keywordMatchTypeSearchParameter = new
> > v200909.KeywordMatchTypeSearchParameter();
> > keywordMatchTypeSearchParameter.keywordMatchTypes
> > = new v200909.KeywordMatchType[] { googleMatchType };
>
> > v200909.CountryTargetSearchParameter
> > countryTargetSearchParameter = new
> > v200909.CountryTargetSearchParameter();
> > v200909.CountryTarget ctarget = new
> > v200909.CountryTarget();
> > ctarget.countryCode = _country;
> > countryTargetSearchParameter.countryTargets = new
> > v200909.CountryTarget[] { ctarget };
>
> > v200909.LanguageTargetSearchParameter
> > languageTargetSearchParameter = new
> > v200909.LanguageTargetSearchParameter();
> > v200909.LanguageTarget ltarget = new
> > v200909.LanguageTarget();
> > ltarget.languageCode = _language;
> > languageTargetSearchParameter.languageTargets =
> > new v200909.LanguageTarget[] { ltarget };
>
> > v200909.NgramGroupsSearchParameter
> > ngramGroupsSearchParameter = new v200909.NgramGroupsSearchParameter();
> > if (!_getSynonyms)
> > {
> > ngramGroupsSearchParameter.ngramGroups =
> > keywords;
> > selector.searchParameters = new
> > v200909.SearchParameter[] { relatedToKeywordSearchParameter,
> > keywordMatchTypeSearchParameter, countryTargetSearchParameter,
> > languageTargetSearchParameter, ngramGroupsSearchParameter };
> > }
> > else
> > {
> > selector.searchParameters = new
> > v200909.SearchParameter[] { relatedToKeywordSearchParameter,
> > keywordMatchTypeSearchParameter, countryTargetSearchParameter,
> > languageTargetSearchParameter };
> > }
>
> > // Get related keywords.
> > for (int iX = 0; iX <
> > targetingIdeaPage_numberResultsMax; iX +=
> > targetingIdeaPage_numberResultsPerPage)
> > {
> > paging.startIndex = iX;
> > paging.startIndexSpecified = true;
>
> > _targetingIdeaPage =
> > _targetingIdeaService.get(selector);- Hide quoted text -
>
> - Show quoted text -
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en