Forecastmetrics Date_Range Unexpected error

33 views
Skip to first unread message

Mnk

unread,
Apr 5, 2022, 12:35:21 PM4/5/22
to Google Ads API and AdWords API Forum

Hello, using the forecastmetrics with the keywordplan is ok if i use the interval but if i call it with a date range when i call this function it break


public static function GenerateForecastMetrics(
GoogleAdsClient $googleAdsClient,
int $customerId,
int $keywordPlanId
) {
global $keywordPlanId;

$keywordPlanServiceClient = $googleAdsClient->getKeywordPlanServiceClient(); // Issues a request to generate forecast metrics based on the specific keyword plan ID. $generateForecastMetricsResponse = $keywordPlanServiceClient->generateForecastMetrics( ResourceNames::forKeywordPlan($customerId, $keywordPlanId) );

my customerId and keywordPlanId they are ok if i create the keywordplan with the date_interval i get through this call at generateForecastMetrics. and can print all the info from the docs.
But if i create the keywordplan with a date_interval the call to generateForecastMetrics fail. i don't understand could you help me please.


i share here the pastebin of results and error messages from these two type of call.


the first one using date_interval https://pastebin.com/P9DvLiQY
the second one with error using a date_range: https://pastebin.com/4xg3iwSS

Google Ads API Forum Advisor

unread,
Apr 5, 2022, 4:21:56 PM4/5/22
to mnk.lab...@gmail.com, adwor...@googlegroups.com
Hi Mnk,

Could you privately send us a 'DEBUG' log level request and response log of API communications when you get this error?

The request and response appears similar to the JSON Mappings in our REST documentation with additional headers and information such as  request ID. Here's how to turn on logging.

Regards,

Google Logo
Aryeh
Google Ads API Team
 


ref:_00D1U1174p._5004Q2ZK11d:ref

Mnk

unread,
Apr 6, 2022, 7:55:29 AM4/6/22
to Google Ads API and AdWords API Forum
I reply only to you normally, tell me if i do it good :)
Thks

Google Ads API Forum Advisor

unread,
Apr 6, 2022, 9:32:26 AM4/6/22
to mnk.lab...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for providing more details to your concern.

Would you be able also to provide the complete API request and response logs with request ID and request header generated on your end for the successful API request where date_interval was set? We will be needing this so that we can compare it with the failed API request to see if there is another reason why the error occurred.

You can provide it via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Regards,
Google Logo
Ernie John
Google Ads API Team
 


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