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 ?

Le vendredi 18 mars 2022 à 16:17:36 UTC+2, adsapi a écrit :

> Hi there,
>
> Thanks for getting back to us.
>
> Kindly note that GenerateForecastMetrics(*GenerateForecastMetricsRequest* 
> <https://developers.google.com/google-ads/api/reference/rpc/v10/GenerateForecastMetricsRequest>)
>  
> will return the requested Keyword Plan forecasts. As per our migration 
> guide, you may refer to services below:
>
>    - *KeywordPlanAdGroupService* 
>    
> <https://developers.google.com/google-ads/api/reference/rpc/v10/KeywordPlanAdGroupService>
>  
>    - *KeywordPlanCampaignService* 
>    
> <https://developers.google.com/google-ads/api/reference/rpc/v10/KeywordPlanCampaignService>
>  
>    - *KeywordPlanIdeaService* 
>    
> <https://developers.google.com/google-ads/api/reference/rpc/v10/KeywordPlanIdeaService>
>  
>    - *KeywordPlanService* 
>    
> <https://developers.google.com/google-ads/api/reference/rpc/v10/KeywordPlanService>
>  
>
> Responses will vary depending on the service in the request.
>
> Let us know if you have any further questions.
>
> Regards,
> [image: Google Logo] 
> Yasar 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2YomeI:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/18dfc49a-907d-45f8-a2bb-1c8a5154e40cn%40googlegroups.com.
  • cl... Mnk
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... Mnk
        • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
          • ... Mnk
            • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
              • ... Mnk
                • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
    • ... Ngon Nguyen

Reply via email to