PHP v2009 Monthly Search Volume

156 views
Skip to first unread message

a2b

unread,
Nov 17, 2009, 9:55:26 PM11/17/09
to AdWords API Forum
I have spent hours of trial & error and searching the net/
documentation to try and get the monthly search volume for a specific
keyword/search term. I have been very unsuccessful... I can't seem
to find any sample code for this for the v2009 API. Below is some
general code I have been trying to use... Any thoughts or examples to
point me in the right direction would be greatly appreciated. Thanks!

$user = new AdWordsUser();
$keywordService = $user->GetTargetingIdeaService();

$keyword = new Keyword();
$keyword->text = 'milk';
$keyword->matchType = 'EXACT';
$keyword_array = array($keyword);

$relatedToKeywordSearchParameter = new RelatedToKeywordSearchParameter
($keyword_array);

$targetingIdeaSelector = new TargetingIdeaSelector();
$targetingIdeaSelector->searchParameters = array(
$relatedToKeywordSearchParameter
);

$targetingIdeaSelector->ideaType = 'KEYWORD';
$targetingIdeaSelector->requestType = 'IDEAS';
$targetingIdeaSelector->paging = new Paging(0,800);


$keywordPage = $keywordService->get($targetingIdeaSelector);

//the following displays nothing about the search volume
var_dump($keywordPage);

AdWords API Advisor

unread,
Nov 18, 2009, 11:46:21 AM11/18/09
to AdWords API Forum
Hi,

Monthly search volume information is available, but isn't returned by
default. To return extra information you must set the field
"requestedAttributeTypes" on the TargetingIdeaSelector:
http://code.google.com/apis/adwords/v2009/docs/reference/TargetingIdeaService.TargetingIdeaSelector.html#requestedAttributeTypes.
There are a variety of attributes available:
http://code.google.com/apis/adwords/v2009/docs/reference/TargetingIdeaService.AttributeType.html.
I believe the attribute you are looking for is
AVERAGE_TARGETED_MONTHLY_SEARCHES.

Best,
- Eric Koleda, AdWords API Team

a2b

unread,
Nov 18, 2009, 4:04:52 PM11/18/09
to AdWords API Forum
I tried that and got back an array of 299 or so elements which were
all NULL. See below:

object(TargetingIdeaPage)#38 (2) {
["totalNumEntries"]=>
int(300)
["entries"]=>
array(300) {
[0]=>
object(TargetingIdea)#37 (1) {
["data"]=>
NULL
}
[1]=>
object(TargetingIdea)#36 (1) {
["data"]=>
NULL
}
[2]=>
object(TargetingIdea)#35 (1) {
["data"]=>
NULL
}
..............




I was able to get slightly better results with
TARGETED_MONTHLY_SEARCHES but all the counts are still NULL. Is this
because it is in the sandbox? I would assume the sandbox would just
return fake numbers, not null.


["value"]=>
array(12) {
[0]=>
object(MonthlySearchVolume)#4524 (3) {
["year"]=>
int(2009)
["month"]=>
int(10)
["count"]=>
NULL
}
[1]=>
object(MonthlySearchVolume)#4525 (3) {
["year"]=>
int(2009)
["month"]=>
int(9)
["count"]=>
NULL
}
[2]=>



Thank you for your help!


AdWords API Advisor

unread,
Nov 18, 2009, 5:20:45 PM11/18/09
to AdWords API Forum
Hi,

Are you making requests against the sandbox or production
environment? The sandbox environment will not return real data for
this service.

Best,
- Eric

a2b

unread,
Nov 18, 2009, 5:30:48 PM11/18/09
to AdWords API Forum
The sandbox -- I am about to test with production. What I don't
understand is there is no fake data -- it's simply NULL?





On Nov 18, 2:20 pm, AdWords API Advisor <adwordsapiadvi...@google.com>
wrote:

a2b

unread,
Nov 18, 2009, 6:05:52 PM11/18/09
to AdWords API Forum
I ran it on production and was able to get data back. Are these
numbers suppose to line up with the KeywordToolExternal?

https://adwords.google.com/select/KeywordToolExternal

The numbers seem to be quite different.

AdWords API Advisor

unread,
Nov 18, 2009, 6:21:46 PM11/18/09
to AdWords API Forum
Hi,

I'm glad to hear you have it working now. The TargetingIdeaService is
more closely related to the Search-Based Keyword Tool:

http://www.google.com/sktool/.

The results from this tool and the TargetingIdeaService may be
different that those from the old Keyword Tool and
KeywordToolService:

http://www.google.com/support/sktool/bin/answer.py?hl=en&answer=114875.

Best,
- Eric

a2b

unread,
Nov 18, 2009, 7:13:04 PM11/18/09
to AdWords API Forum
Great, thank you for all your help. One more question... I am getting
back the following:

Keyword: milk
MatchType: EXACT
Global monthly searches: 1,000,000
Average monthly searches: 1,000,000


Shouldn't the Global and Monthly numbers be different? I am unclear
how you specify the location for the local result. Is it just based
off the API Account location?

Thanks again!




On Nov 18, 3:21 pm, AdWords API Advisor <adwordsapiadvi...@google.com>

AdWords API Advisor

unread,
Nov 19, 2009, 9:26:12 AM11/19/09
to AdWords API Forum
Hi,

The AVERAGE_TARGETED_MONTHLY_SEARCHES attribute is based of the
targeting search parameters used in the request. For example:

CountryTargetSearchParameter:
http://code.google.com/apis/adwords/v2009/docs/reference/TargetingIdeaService.CountryTargetSearchParameter.html

LanguageTargetSearchParameter:
http://code.google.com/apis/adwords/v2009/docs/reference/TargetingIdeaService.LanguageTargetSearchParameter.html

Best,
- Eric

a2b

unread,
Nov 19, 2009, 3:47:27 PM11/19/09
to AdWords API Forum
Great, it looks like I got everything working. Thank you for all your
help.

The targeted monthly searches gives data back for last 12 months. Is
there a normal time frame that the previous months count becomes
available? So on 12/1 will November search count be available?





On Nov 19, 6:26 am, AdWords API Advisor <adwordsapiadvi...@google.com>
wrote:
> Hi,
>
> The AVERAGE_TARGETED_MONTHLY_SEARCHES attribute is based of the
> targeting search parameters used in the request. For example:
>
>   CountryTargetSearchParameter:http://code.google.com/apis/adwords/v2009/docs/reference/TargetingIde...
>
>   LanguageTargetSearchParameter:http://code.google.com/apis/adwords/v2009/docs/reference/TargetingIde...

Owen

unread,
Nov 19, 2009, 10:18:51 PM11/19/09
to AdWords API Forum
Could you provide the XML for a working example?

Thanks.
> > > > The results from this tool and theTargetingIdeaServicemay be

a2b

unread,
Nov 20, 2009, 3:23:38 PM11/20/09
to AdWords API Forum
Hope this helps!


<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:ns1="https://adwords.google.com/api/adwords/cm/
v200909" xmlns:ns2="https://adwords.google.com/api/adwords/o/v200909"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header>
<ns2:RequestHeader xsi:type="ns2:RequestHeader">
<ns1:applicationToken>***********</ns1:applicationToken>
<ns1:authToken>*****</ns1:authToken>
<ns1:clientEmail>**********</ns1:clientEmail>
<ns1:developerToken>*************</ns1:developerToken>
<ns1:userAgent>AdWords API PHP Client LIbrary - v1.1.0 -
userAgent1</ns1:userAgent>
</ns2:RequestHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns2:get xsi:type="get">
<ns2:selector xsi:type="ns2:TargetingIdeaSelector">
<ns2:searchParameters
xsi:type="ns2:RelatedToKeywordSearchParameter">
<ns2:keywords xsi:type="ns1:Keyword">
<ns1:text>milk</ns1:text>
<ns1:matchType>EXACT</ns1:matchType>
</ns2:keywords>
</ns2:searchParameters>
<ns2:searchParameters
xsi:type="ns2:CountryTargetSearchParameter">
<ns2:countryTargets xsi:type="ns1:CountryTarget">
<ns1:countryCode>US</ns1:countryCode>
</ns2:countryTargets>
</ns2:searchParameters>
<ns2:ideaType>KEYWORD</ns2:ideaType>
<ns2:requestType>IDEAS</ns2:requestType>
<ns2:requestedAttributeTypes>TARGETED_MONTHLY_SEARCHES</
ns2:requestedAttributeTypes>

<ns2:requestedAttributeTypes>AVERAGE_TARGETED_MONTHLY_SEARCHES</
ns2:requestedAttributeTypes>
<ns2:requestedAttributeTypes>GLOBAL_MONTHLY_SEARCHES</
ns2:requestedAttributeTypes>
<ns2:requestedAttributeTypes>KEYWORD</
ns2:requestedAttributeTypes>
<ns2:paging xsi:type="ns1:Paging">
<ns1:startIndex>0</ns1:startIndex>
<ns1:numberResults>3</ns1:numberResults>
</ns2:paging>
<ns2:localeCode>en_US</ns2:localeCode>
</ns2:selector>
</ns2:get>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


AdWords API Advisor

unread,
Nov 23, 2009, 12:29:09 PM11/23/09
to AdWords API Forum
Hi,

The data for targeted monthly searches for a given month should be
available within a week of the end of the month.

Best,
- Eric

google.ap...@servo-server.net

unread,
Nov 23, 2009, 4:25:59 PM11/23/09
to AdWords API Forum
Hi NG,

I have a working version of the TargetingIdeaService (thanks to a lot
of help from this group),
the only thing I cant find in the documentation is the cpc in relation
to a keyword. Idealy I want
to have a list of

keyword AVERAGE_TARGETED_MONTHLY_SEARCHES cpc
keyword AVERAGE_TARGETED_MONTHLY_SEARCHES cpc
keyword AVERAGE_TARGETED_MONTHLY_SEARCHES cpc
keyword AVERAGE_TARGETED_MONTHLY_SEARCHES cpc
keyword AVERAGE_TARGETED_MONTHLY_SEARCHES cpc

I have col 1 (keyword) and col 2 (AVERAGE_TARGETED_MONTHLY_SEARCHES)
but dont
find a way to get cpc added to it.

Is it possible ? Cant find anything in the documentation.

Thanks in advance.

On 20 Nov., 21:23, a2b <a2b2...@gmail.com> wrote:
> Hope this helps!
>
> <?xml version="1.0" encoding="UTF-8"?>
> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
> envelope/" xmlns:ns1="https://adwords.google.com/api/adwords/cm/
> v200909" xmlns:ns2="https://adwords.google.com/api/adwords/o/v200909"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>   <SOAP-ENV:Header>
>     <ns2:RequestHeader xsi:type="ns2:RequestHeader">
>       <ns1:applicationToken>***********</ns1:applicationToken>
>       <ns1:authToken>*****</ns1:authToken>
>       <ns1:clientEmail>**********</ns1:clientEmail>
>       <ns1:developerToken>*************</ns1:developerToken>
>       <ns1:userAgent>AdWords APIPHPClient LIbrary - v1.1.0 -

AdWords API Advisor

unread,
Nov 23, 2009, 7:01:03 PM11/23/09
to AdWords API Forum
Hi,

Unfortunately it isn't possible to retrieve CPC or bidding information
from the TargetingIdeaService at this time. The issue is discussed
further in this thread:

http://groups.google.com/group/adwords-api/browse_thread/thread/186b1f34eee95d30

Best,
- Eric

On Nov 23, 4:25 pm, "google.api.adwo...@servo-server.net"

keesjan

unread,
Dec 6, 2009, 3:10:49 PM12/6/09
to AdWords API Forum
Hi Eric,
we see empty data for the last month till 7 days after the first day
of avery month. Can you confirm this? So 'within a week' is very
hopefull ;-)
Can you ask th engineer team if this will be a shorter time period or
stays about 7 days?
Kind of disturbing in the logica: last month figures from the fist
day of the next month is expected.
Best,
Keesjan

On Nov 23, 6:29 pm, AdWords API Advisor <adwordsapiadvi...@google.com>
wrote:
> Hi,
>
> The data for targeted monthly searches for a given month should be
> available within a week of the end of the month.
>
> Best,
> - Eric
>
> On Nov 19, 3:47 pm, a2b <a2b2...@gmail.com> wrote:
>
> > Great, it looks like I got everything working.  Thank you for all your
> > help.
>
> > The targeted monthly searches gives data back for last 12 months.  Is
> > there a normal time frame that the previous months count becomes
> > available? So on 12/1 will Novembersearchcount be available?
>
> > On Nov 19, 6:26 am, AdWords API Advisor <adwordsapiadvi...@google.com>
> > wrote:
>
> > > Hi,
>
> > > The AVERAGE_TARGETED_MONTHLY_SEARCHES attribute is based of the
> > > targetingsearchparameters used in the request. For example:
>
> > >   CountryTargetSearchParameter:http://code.google.com/apis/adwords/v2009/docs/reference/TargetingIde...
>
> > >   LanguageTargetSearchParameter:http://code.google.com/apis/adwords/v2009/docs/reference/TargetingIde...
>
> > > Best,
> > > - Eric
>
> > > On Nov 18, 7:13 pm, a2b <a2b2...@gmail.com> wrote:
>
> > > > Great, thank you for all your help.  One more question... I am getting
> > > > back the following:
>
> > > > Keyword: milk
> > > > MatchType: EXACT
> > > > Global monthly searches:        1,000,000
> > > > Average monthly searches:       1,000,000
>
> > > > Shouldn't the Global and Monthly numbers be different?  I am unclear
> > > > how you specify the location for the local result.  Is it just based
> > > > off the API Account location?
>
> > > > Thanks again!
>
> > > > On Nov 18, 3:21 pm, AdWords API Advisor <adwordsapiadvi...@google.com>
> > > > wrote:
>
> > > > > Hi,
>
> > > > > I'm glad to hear you have it working now.  The TargetingIdeaService is
> > > > > more closely related to theSearch-Based Keyword Tool:

AdWords API Advisor

unread,
Dec 7, 2009, 10:42:14 AM12/7/09
to AdWords API Forum
Hi Keesjan,

I believe 7 days is "within a week", if just barely. :-) I don't have
any information about if or when this delay could change.

Best,
- Eric

keesjan

unread,
Dec 7, 2009, 3:18:34 PM12/7/09
to AdWords API Forum
Hi Eric,
so the delay is not a bug, its not seen as not ok? Icanot live with
that if I was a Google engineer. is it possible you ask the API
engineer team if this is going to change? Is the online keyword tool
also behave like this?
sincerly,
Keesjan

On Dec 7, 4:42 pm, AdWords API Advisor <adwordsapiadvi...@google.com>

keesjan

unread,
Dec 16, 2009, 7:48:14 AM12/16/09
to AdWords API Forum
Hi Eric,
is the status quo still the delay for 1 week? Will this be resolved or
not?

hikmetcancelik

unread,
Dec 16, 2009, 2:42:36 PM12/16/09
to AdWords API Forum
Hi Eric,

Would you also please tell me why TargetingIdeaService is not
returning the supplied keyword information?
Do I have to make paging 100 in order to get the info for keyword I'm
asking for?(Which wastes 100 api unit ?)

Thanks

On Nov 18, 3:21 pm, AdWords API Advisor <adwordsapiadvi...@google.com>

AdWords API Advisor

unread,
Dec 17, 2009, 12:16:40 PM12/17/09
to AdWords API Forum
Hi Keesjan,

The message from the engineering team is that last month's data will
be available within a week of the end of the month. This is the
current behavior, and there are no plans to change it that I am aware
of.

Best,
- Eric

google.ap...@servo-server.net

unread,
Dec 20, 2009, 3:21:25 PM12/20/09
to AdWords API Forum
Hi NG,

can someone shed some light on the results from the targeting idea
service.

I have 3 keywords :

wexford hotel
wexford b&b
wexford hotels

My settings are :

$languageService->languageCode='en';
$languageService->TargetType='en';
$countryService->countryTargets='IE';

$targetingIdeaSelector->ideaType = 'KEYWORD';
$targetingIdeaSelector->requestType = 'STATS';
$targetingIdeaSelector->requestedAttributeTypes=array
( 'KEYWORD','AVERAGE_TARGETED_MONTHLY_SEARCHES');
matchType = exact;

Results I am getting :

wexford hotel 1300
wexford b&b 170
wexford hotels 5400

Results from https://adwords.google.com/select/KeywordToolExternal

Settings : English / Ireland

[wexford hotels] 4.400
[wexford hotel] 1.000
wexford b&b 140

Dont understand where the differents is coming from. Does anybody
know ?
Does it matter what country the developer or application key is
registered under ?

Thanks for any hint in adavance.


On 17 Dez., 18:16, AdWords API Advisor <adwordsapiadvi...@google.com>

AdWords API Advisor

unread,
Dec 21, 2009, 11:43:04 AM12/21/09
to AdWords API Forum
Hi,

As discussed earlier in this thread, the results from the
TargetingIdeaService and Search-based Keyword Tool will differ from
that of the KeywordToolService or classic Keyword Tool web interface:

http://www.google.com/support/sktool/bin/answer.py?hl=en&answer=114875

Best,
- Eric

On Dec 20, 3:21 pm, "google.api.adwo...@servo-server.net"


<google.api.adwo...@servo-server.net> wrote:
> Hi NG,
>
> can someone shed some light on the results from the targeting idea
> service.
>
> I have 3 keywords :
>
> wexford hotel
> wexford b&b
> wexford hotels
>
> My settings are :
>
>  $languageService->languageCode='en';
>  $languageService->TargetType='en';
>  $countryService->countryTargets='IE';
>
>  $targetingIdeaSelector->ideaType = 'KEYWORD';
>  $targetingIdeaSelector->requestType = 'STATS';
>  $targetingIdeaSelector->requestedAttributeTypes=array
> ( 'KEYWORD','AVERAGE_TARGETED_MONTHLY_SEARCHES');
>  matchType = exact;
>
> Results I am getting :
>
> wexford hotel   1300
> wexford b&b         170
> wexford hotels  5400
>

> Results fromhttps://adwords.google.com/select/KeywordToolExternal

keesjan

unread,
Dec 22, 2009, 4:54:34 PM12/22/09
to AdWords API Forum
Thanks Eric

On Dec 17, 6:16 pm, AdWords API Advisor <adwordsapiadvi...@google.com>

keesjan

unread,
Dec 22, 2009, 4:56:38 PM12/22/09
to AdWords API Forum
One more question:
As The TargetingIdeaService is closely related to the Search-Based
Keyword Tool:

http://www.google.com/sktool/.

We get back a lot of times 'only' 167 keyword variations while in the
online Search-Based Keyword Tool we get back up to 800 keyword
variations.
Is this normal, is there a setting teh get more then our average of
167?

On Dec 21, 5:43 pm, AdWords API Advisor <adwordsapiadvi...@google.com>

AdWords API Advisor

unread,
Dec 22, 2009, 5:47:43 PM12/22/09
to AdWords API Forum
Hi Keesjan,

There is no special limit of 167 keyword ideas. I would double check
that your search parameters are the same as the online search, and
that you have set the paging values correctly.

Best,
- Eric

Reply all
Reply to author
Forward
0 new messages