Hi everybody,
I have found many post discussing about what I have been looking for about 2 days.
I hope I will find some answers here and I want to thank all the potential reader and answer people.
To begin with, I use PHP Google Adwords v201705 library.
The goal is : to pick all daily cost group by countrycode from my Google Adwords.
First thing I want to do is to show up that cost on the command prompt (for example : US : 33333000) (I know I have to divide the result) and after insert it in my database.
I have seen that we cannot do that with that way, we have to create a .csv report and grap these datas, so i would need to create that special CSV and read datas in it (for example with a SQL query).
I finally get focuse on the Geo Performance Report, so i finally manage to get the cost order by the CountryCriteriaId.
$selector = new Selector();
$selector->setFields(['CountryCriteriaId', 'Cost']);
$selector->setPredicates([
new Predicate('CampaignStatus', PredicateOperator::NOT_IN, ['PAUSED'])]);
$arg = new LocationCriterionServiceGet($selector);
var_dump($arg);
// Create report definition.
$reportDefinition = new ReportDefinition();
$reportDefinition->setSelector($selector);
$reportDefinition->setReportName(
'Criteria performance report #' . uniqid());
$reportDefinition->setDateRangeType(
ReportDefinitionDateRangeType::YESTERDAY);
$reportDefinition->setReportType(
ReportDefinitionReportType::GEO_PERFORMANCE_REPORT);
$reportDefinition->setDownloadFormat(DownloadFormat::CSV);
I grap a special code in the column : "Country/Territory", I have seen google make a .csv correspondance with that number.
But I want to involve to make that comparaison file and get directly the countrycode (ES, FR, GB..)
I have seen that it exists a tool : LocationCriteronService but i still don't understand the way it works.
If someone could help me, i would be grateful.
Thank you for your time