class EstimateKeywordTraffic google-ads-php

108 views
Skip to first unread message

Mnk

unread,
Mar 17, 2022, 5:13:28 AM3/17/22
to Google Ads API and AdWords API Forum
Hello All  !

I do the migration from The AdWords API to the Google Ads API.

I try to find the "new way" to use the class "EstimateKeywordTraffic" but no way.

Do you know what is the way (template) today ?

Actually i use this --> https://developers.google.com/adwords/api/docs/samples/php/optimization

Thanks in Advance

Google Ads API Forum Advisor

unread,
Mar 17, 2022, 10:36:27 AM3/17/22
to mnk.lab...@gmail.com, adwor...@googlegroups.com
Hello,

Thanks for reaching out. I recommend looking through the migration guide's "Migrating AdWords API Services to Google Ads API Services" page. The TrafficEstimatorService functionality is now handled by various planning services. You can read more about these services here.

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2YomeI:ref

Mnk

unread,
Mar 17, 2022, 12:51:40 PM3/17/22
to Google Ads API and AdWords API Forum
Thanks Matt,
If i good understood i need to see the "Generate Forecast Metrics" for replace the precedent class named "EstimateKeywordTraffic".

I will check it.
The result (API answer) it's the same like the precedent one or it's change too ?

Ngon Nguyen

unread,
Mar 17, 2022, 8:06:14 PM3/17/22
to mnk.lab...@gmail.com, Google Ads API and AdWords API Forum
Chào mừng bạn đến với bảng nhớ tạm của Gboard, bất kỳ văn bản nào bạn sao chép sẽ được lưu tại đây.Sử dụng biểu tượng chỉnh sửa để ghim, thêm hoặc xóa đoạn.Nhấn vào một đoạn để dán vào hộp văn bản.Chạm và giữ một đoạn để ghim đoạn đó. Các đoạn đã bỏ ghim sẽ bị xóa sau 1 giờ.

Vào 16:13, Th 5, 17 thg 3, 2022 Mnk <mnk.lab...@gmail.com> đã viết:
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/796fe33d-11dd-4cf2-9d44-06187a73fdf6n%40googlegroups.com.

Google Ads API Forum Advisor

unread,
Mar 18, 2022, 10:17:36 AM3/18/22
to mnk.lab...@gmail.com, adwor...@googlegroups.com

Hi there,

Thanks for getting back to us.

Kindly note that GenerateForecastMetrics(GenerateForecastMetricsRequest) will return the requested Keyword Plan forecasts. As per our migration guide, you may refer to services below:

Responses will vary depending on the service in the request.

Let us know if you have any further questions.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2YomeI:ref

Mnk

unread,
Mar 21, 2022, 10:52:20 AM3/21/22
to Google Ads API and AdWords API Forum
Hey ,

Ok i understood so i follow the process and adapt the code to my project ( i use Laravel 6 ).

Now when i try to do my call of the "runExample" function (renamed to runkeywordplan in my code), i get :
Too few arguments to function Google\\Ads\\GoogleAds\\Lib\\V10\\GoogleAdsClient::__construct(), 0 passed in C:\\wamp64\\www\\app\\app\\Services\\EstimateKeywordTraffic3.php on line 348 and exactly 1 expected"  

Function :
```
    public static function main($data) {
        $config = base_path() . '/google_ads_php.ini';
       
        // Generate a refreshable OAuth2 credential for authentication.
        $oAuth2Credential = (new OAuth2TokenBuilder())
            ->fromFile($config)
            ->build();
       
        // Construct a Google Ads client configured from a properties file and the
        // OAuth2 credentials above.
        $googleAdsClient = (new GoogleAdsClientBuilder())
            ->fromFile($config)
            ->withOAuth2Credential($oAuth2Credential)
            ->build();
       
        return self::runkeywordplan(new GoogleAdsClient(), $googleAdsClient, $data);
     
    }
```
In my controller i call --> $results = EstimateKeywordTraffic3::main($data);

Do you know where is my mistake ?

Google Ads API Forum Advisor

unread,
Mar 22, 2022, 4:10:55 AM3/22/22
to mnk.lab...@gmail.com, adwor...@googlegroups.com

Hello,

Thank you for getting back to us.

Please note that this forum channel can only provide assistance (via email only) to issues/concerns related to the AdWords API / Google Ads API.

To guide you through your implementation, you can check on some of the sample codes below related to Keyword Planning.

If you encounter any API-related errors, kindly share to us the complete API logs (request and response with request-id) privately so our team can further check.

For more concerns related to its implementation using the PHP client library, we recommend that you reach out to the Client library owners via this link instead. Client library owners should be able to provide more details/guidance on the process of adapting the code to your project.

Regards,

Google Logo
Mark Kevin
Google Ads API Team
 


ref:_00D1U1174p._5004Q2YomeI:ref
Message has been deleted

Google Ads API Forum Advisor

unread,
Mar 23, 2022, 3:20:21 AM3/23/22
to mnk.lab...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for providing updates to your concern. I am also a member of the Google Ads API team and let me provide support to your concern.

The USER_PERMISSION_DENIED error occurs when you're not specifying the customer ID of the Google Ads Account, wherein your login user account / email address (that you've used to generate Oauth2 credential) has direct access, to the login-customer-id field. If your login user account / email address has access to the MCC account, then its customer ID must be set in the login-customer-id field header.

Let me know if you have further questions.

Regards,
Google Logo
Ernie John
Google Ads API Team
 


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