Google Adword API - Not getting data for some of the Keywords.

142 views
Skip to first unread message

Neetu Varshney

unread,
Nov 19, 2020, 8:49:09 AM11/19/20
to AdWords API and Google Ads API Forum
Hello Team,


It is giving data for many of the "keywords like Paytm, apple, iPhone, amazon" etc.
But It is not giving data for some of the keywords like - "Covid 19, Trump, Biden, etc"

So I am not finding anything, please suggest to me how can I get data for all the keywords.

Thanks,
Neetu Varshney

Google Ads API Forum Advisor Prod

unread,
Nov 19, 2020, 9:53:16 PM11/19/20
to neetu.var...@gmail.com, adwor...@googlegroups.com

Hi Neetu,

Thanks for posting your concern.

Please ensure to specify the list of seed keywords related to the results that you expecting to show (e.g. Covid 19, Trump, Biden). You may refer to this guide to know read more details on how to prepare request for retrieving keywords ideas.

Regards,

Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q27v7E8:ref

Neetu Varshney

unread,
Nov 19, 2020, 11:35:45 PM11/19/20
to AdWords API and Google Ads API Forum
Hello Ernie
Thanks for the reply,

As I am already following the same guideline (provided by you). I am getting "0" Search Volume for these keywords "Covid 19, Trump, Biden". Please suggest me so that I can get the right data.

Google Ads API Forum Advisor Prod

unread,
Nov 20, 2020, 12:59:24 PM11/20/20
to neetu.var...@gmail.com, adwor...@googlegroups.com
Hi Neetu,

I ran the code sample against my account, using the phrases 'Covid 19', 'Biden' and 'Trump', and I did get results by changing line 179:

    relatedToQuerySearchParameter.setQueries(new String[] {"bakery", "pastries", "birthday cake"});

Are you providing an ad group ID as an argument for the keyword planner? 

Thanks,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q27v7E8:ref

Neetu Varshney

unread,
Nov 23, 2020, 3:12:51 AM11/23/20
to AdWords API and Google Ads API Forum
Hello Matt,
Thanks for the reply

As I using the code from https://github.com/googleads/googleads-php-lib/blob/6c3e8c7c7d5023535a836a7a65e6813fcca6d9ae/examples/AdWords/v201809/Optimization/GetKeywordIdeas.php here, and I get result for "bakery", "pastries", "birthday cake", but as I changed these keywords by "Biden, Covid 19" etc, then got no values of "Search Volume", CPC, etc.

I am using the same code from the above URL, only changed the authentication cofiguration. 
Please help me.

Google Ads API Forum Advisor Prod

unread,
Nov 23, 2020, 9:30:07 PM11/23/20
to neetu.var...@gmail.com, adwor...@googlegroups.com
Hi Neetu,

So our team can investigate this further, could you provide your customer ID and the complete request and response logs that were generated?

In addition, could you confirm whether the same input generated results in the Keyword Planner? If yes, could you also send a screenshot?

You may send the requested details using the Reply privately to author option.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q27v7E8:ref

Neetu Varshney

unread,
Nov 23, 2020, 11:43:28 PM11/23/20
to AdWords API and Google Ads API Forum
Hello Peter,
Can you share your piece of code for the keywords "trump, biden" that is working nicely on your side?
Also, I do not have permission for the option for "Reply privately to author".

Here is my request file:-

<?php
require __DIR__ . '/../../vendor/autoload.php';
use Google\AdsApi\AdWords\AdWordsServices;
use Google\AdsApi\AdWords\AdWordsSession;
use Google\AdsApi\AdWords\AdWordsSessionBuilder;
use Google\AdsApi\AdWords\v201809\cm\Language;
use Google\AdsApi\AdWords\v201809\cm\NetworkSetting;
use Google\AdsApi\AdWords\v201809\cm\Paging;
use Google\AdsApi\AdWords\v201809\o\AttributeType;
use Google\AdsApi\AdWords\v201809\o\IdeaType;
use Google\AdsApi\AdWords\v201809\o\LanguageSearchParameter;
use Google\AdsApi\AdWords\v201809\o\NetworkSearchParameter;
use Google\AdsApi\AdWords\v201809\o\RelatedToQuerySearchParameter;
use Google\AdsApi\AdWords\v201809\o\RequestType;
use Google\AdsApi\AdWords\v201809\o\SeedAdGroupIdSearchParameter;
use Google\AdsApi\AdWords\v201809\o\TargetingIdeaSelector;
use Google\AdsApi\AdWords\v201809\o\TargetingIdeaService;
use Google\AdsApi\Common\OAuth2TokenBuilder;
use Google\AdsApi\Common\Util\MapEntries;

class GetKeywordIdeas
{

// If you do not want to use an existing ad group to seed your request, you
// can set this to null.
const AD_GROUP_ID = null;
const PAGE_LIMIT = 500;

public static function runExample(
AdWordsServices $adWordsServices,
AdWordsSession $session,
$adGroupId
) {
$targetingIdeaService = $adWordsServices->get($session, TargetingIdeaService::class);

// Create selector.
$selector = new TargetingIdeaSelector();
$selector->setRequestType(RequestType::STATS);
$selector->setIdeaType(IdeaType::KEYWORD);
$selector->setRequestedAttributeTypes(
[
AttributeType::KEYWORD_TEXT,
AttributeType::SEARCH_VOLUME,
AttributeType::AVERAGE_CPC,
AttributeType::COMPETITION,
AttributeType::CATEGORY_PRODUCTS_AND_SERVICES
]
);

$paging = new Paging();
$paging->setStartIndex(0);
$paging->setNumberResults(10);
$selector->setPaging($paging);

$searchParameters = [];
// Create related to query search parameter.
$relatedToQuerySearchParameter = new RelatedToQuerySearchParameter();
$relatedToQuerySearchParameter->setQueries(
[
'Trump', 'biden'
]
);
$searchParameters[] = $relatedToQuerySearchParameter;

// Create language search parameter (optional).
// The ID can be found in the documentation:
$languageParameter = new LanguageSearchParameter();
$english = new Language();
$english->setId(1000);
$languageParameter->setLanguages([$english]);
$searchParameters[] = $languageParameter;

// Create network search parameter (optional).
$networkSetting = new NetworkSetting();
$networkSetting->setTargetGoogleSearch(true);
$networkSetting->setTargetSearchNetwork(false);
$networkSetting->setTargetContentNetwork(false);
$networkSetting->setTargetPartnerSearchNetwork(false);

$networkSearchParameter = new NetworkSearchParameter();
$networkSearchParameter->setNetworkSetting($networkSetting);
$searchParameters[] = $networkSearchParameter;

// Optional: Use an existing ad group to generate ideas.
if (!empty($adGroupId)) {
$seedAdGroupIdSearchParameter = new SeedAdGroupIdSearchParameter();
$seedAdGroupIdSearchParameter->setAdGroupId($adGroupId);
$searchParameters[] = $seedAdGroupIdSearchParameter;
}
$selector->setSearchParameters($searchParameters);
$selector->setPaging(new Paging(0, self::PAGE_LIMIT));

// Get keyword ideas.
$page = $targetingIdeaService->get($selector);

// Print out some information for each targeting idea.
$entries = $page->getEntries();
if ($entries !== null) {
foreach ($entries as $targetingIdea) {
$data = MapEntries::toAssociativeArray($targetingIdea->getData());
$keyword = $data[AttributeType::KEYWORD_TEXT]->getValue();
$searchVolume = ($data[AttributeType::SEARCH_VOLUME]->getValue() !== null)
? $data[AttributeType::SEARCH_VOLUME]->getValue() : 0;
$averageCpc = $data[AttributeType::AVERAGE_CPC]->getValue();
$competition = $data[AttributeType::COMPETITION]->getValue();
$categoryIds = ($data[AttributeType::CATEGORY_PRODUCTS_AND_SERVICES]->getValue() === null)
? $categoryIds = ''
: implode(
', ',
$data[AttributeType::CATEGORY_PRODUCTS_AND_SERVICES]->getValue()
);
$aFinalArray = [];
$aSubArray = [];
$arr[] = array('keyword' => $keyword, 'cpc' => $averageCpc, 'competition' => $competition, 'search_volumenew' => $searchVolume);
}
$aFinalArray = $arr;
echo "<pre>"; print_r($aFinalArray); die;
}

if (empty($entries)) {
print "No related keywords were found.\n";
}
}

public static function main()
{
$adsConfigPath = __DIR__ . '/../adsapi_php.ini';   // My config file
$oAuth2Credential = (new OAuth2TokenBuilder())->fromFile($adsConfigPath)->build();
$session = (new AdWordsSessionBuilder())->fromFile($adsConfigPath)->withOAuth2Credential($oAuth2Credential)->build();
$aDataInfo = self::runExample(new AdWordsServices(), $session, self::AD_GROUP_ID);
}
}

GetKeywordIdeas::main();

Google Ads API Forum Advisor Prod

unread,
Nov 24, 2020, 9:55:35 PM11/24/20
to neetu.var...@gmail.com, adwor...@googlegroups.com
Hi Neetu,

This is the document that we followed on retrieving keyword ideas.

Please provide the requested details on this email address googleadsa...@google.com instead for privacy purposes.

Also, we can accurately investigate if you can provide the complete request and response logs that were generated? You may enable logging of API transactions by following this guide for PHP client library.

Please also include the results/screenshots of your Keyword Planner request using the keywords you mentioned.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q27v7E8:ref
Message has been deleted

Google Ads API Forum Advisor Prod

unread,
Nov 25, 2020, 9:59:51 PM11/25/20
to neetu.var...@gmail.com, adwor...@googlegroups.com
Hi Neetu,

Unfortunately, our team is unable to open or access the file that you have attached. Furthermore, I had to delete your response and re-post it below as the file you contained may contain your account information.

"Hello Ernie,
Greetings of the day!!
I am using the same script which you have mentioned in the document.

I have attached the response screenshot here, and I searching keyword stats for "trump and Biden in my request". Please have a look at my attachment.

As I am getting data i.e "KEYWORD_TEXT, SEARCH_VOLUME, AVERAGE_CPC, COMPETITION" for many keywords like "Paytm, cycle, cab, amazon, bakery, etc". So the script which I shared on the above email chain is working fine, the only thing is not providing data for a few keywords like -Covid 19, trump, Biden, etc.
"

That said, since you are not able to reply privately, could you please send a more accessible set of files/details directly to our googleadsa...@google.com alias instead?

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q27v7E8:ref
Reply all
Reply to author
Forward
0 new messages