googleads / googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP
Apache License 2.0
656 stars 769 forks source link

TrafficEstimatorService with multiple locations #734

Closed vinothini-skills closed 2 years ago

vinothini-skills commented 2 years ago

I'm working on TrafficEstimatorService to find Average CPC for the keywords. I need to find average CPC for 3 keywords by passing multiple locations too.

So i'm trying by setting ID on Location class and passing it on CampaignEstimateRequest setCriteria funtion.

Here's is my code there im setting location id and setting criteria on CampaignEstimateRequest : `$locationData = new Location(); $locationData->setId(9056360);

$locationData1 = new Location(); $locationData1->setId(9054938);

$locationData2 = new Location(); $locationData2->setId(9112255);

$french = new Language(); $french->setId(1002);

$campaignEstimateRequest->setCriteria([$locationData, $french], [$locationData1, $french], [$locationData2, $french]);`

Initially i set location as entire france country i was getting some results for all the 3 keywords. But when i try by passing multiple location (like the above code), I'm getting results only for 2 keywords so i don't know whether i did it in a proper way or not or there's any better way to do it. Please help me...

fiboknacky commented 2 years ago

Regarding the result of the API, please seek help on the Google Ads API and AdWords API forum. Note that the AdWords API will be sunset in April, 2022. We highly recommend migrating to the Google Ads API as soon as you can.

vinothini-skills commented 2 years ago

Actually I have been redirected from here the Google Ads API and AdWords API forum. They told to ask doubt here. Please let me know where i have to ask my doubt!!!

fiboknacky commented 2 years ago

Could you share the link to the post that you created?

vinothini-skills commented 2 years ago

https://groups.google.com/g/adwords-api/c/iCgWhLZCvHA

fiboknacky commented 2 years ago

Sorry for your confusion. I see now where the confusion came from.

What you asked on the forum was more like a general coding question about the Google Ads API using PHP. That's why Peter suggested you to come here.

But the question you asked above sounds more a general product question. That's not related much to how this library works or whether you code has a bug. I assume your code doesn't have an obvious bug, as you still could get a result back.

Having said that, to be certain about the bugs and be able to answer your questions more specifically, we need you to send us the request and response log. You can do so privately when using the forum I mentioned above. That's why I recommend asking this question in the forum at first place.

If you wish, you can share the log here too, but beware of any sensitive information in your log. Please redact them by yourself when you share it.

Best, Knack