Error using TargetingIdeaService STATS with CategoryProductsAndServicesSearchParameter

59 views
Skip to first unread message

market...@melbourneit.com.au

unread,
Nov 15, 2017, 2:32:57 AM11/15/17
to AdWords API Forum
Hi,
I recently created an AdWords test account and am using the TargetingIdeaService and CategoryProductsAndServicesSearchParameter to retrieve keyword information. I'm using the STATS setting as I want to get results for exact keyword matches (not ideas).

This works correctly when set to IDEAS, however when I use STATS I get the follwoing error message:

Fatal error: Uncaught exception 'Google\AdsApi\AdWords\v201710\cm\ApiException' with message '[TargetingIdeaError.INVALID_SEARCH_PARAMETERS @ selector.searchParameters[0]; trigger:'CategoryProductsAndServicesSearchParameter']' in C:\www-lib\googleads-php-lib\src\Google\AdsApi\Common\Util\Reflection.php on line 39

Example code is attached. Relevant lines are 57 and 82.

Is it not possible to use the CategoryProductsAndServicesSearchParameter when requesting STATS?


Thanks for any advice.
GetKeywordIdeas.php

Vincent Racaza (AdWords API Team)

unread,
Nov 15, 2017, 3:54:20 AM11/15/17
to AdWords API Forum
Hi,

For CategoryProductsAndServicesSearchParameter, only the IDEAS is supported as requestType and not STATS, therefore, your current scenario is not possible at this time.

Let me know if you have further clarifications.

Thanks,
Vincent
AdWords API Team

market...@melbourneit.com.au

unread,
Nov 16, 2017, 6:00:47 PM11/16/17
to AdWords API Forum
Hi Vincent,
One last question for clarity. Is it possible to use the AdWords API to retrieve stats for an exact keyword match?

This would be similar to the initial results of the Keyword Planner where the stats are shown for the 'Your product or service' keywords - see attached.

I'm asking just in case this is achievable using a different service in the AdWords API (as opposed to using the TargetingIdeaService).

Thanks again.
Exact Keywords.png

Vincent Racaza (AdWords API Team)

unread,
Nov 17, 2017, 1:03:24 AM11/17/17
to AdWords API Forum
Hi,

I am afraid that the other stats (Average monthly searches, competition, etc.) based on your screenshot are not available to other services except the TargetingIdeaService.

They are available as attribute types in the said service. For "Average monthly searches", it is equivalent to SEARCH_VOLUME attributeType. For "Competition", the equivalent is COMPETITION, and for "Suggested bid", the equivalent is AVERAGE_CPC. Basically, the results based on your screenshot are supported in this service.

For your search terms also, you just need to use a valid parameter. For these three search terms in your screenshot, these are equivalent to RelatedToQuerySearchParameter. With this parameter and attribute types, you can achieve an API result same as your UI result. You can also check this example (available to other languages that we support) on how to do this.

market...@melbourneit.com.au

unread,
Nov 19, 2017, 6:25:38 PM11/19/17
to AdWords API Forum
Hi,
Thanks for the suggestions (confirms I was on the right track with the code attached at the start of the thread).

To return to my original question regarding CategoryProductsAndServicesSearchParameter and STATS returning an error, I have taken another look at how the Keyword Planner works.

It appears that product/service doesn't change the stats values which are returned per keyword (eg. Avg. Monthly Searches). This explains why CategoryProductsAndServicesSearchParameteris is invalid when using STATS.

Thanks for your help with this.


Reply all
Reply to author
Forward
0 new messages