I am trying to convert reporting that was written for AdWords to this
Google Ads API. This was written in PHP.
What I used to have was:
$reportSettings = (new ReportSettingsBuilder())
->includeZeroImpressions(false)
->skipReportSummary(true)
->build();
$reportSession = (new AdWordsSessionBuilder())
->withOAuth2Credential($this->_oauth)
->withDeveloperToken($this->_authsource['dev_token'
])
->withReportSettings($reportSettings)
->withClientCustomerId($accountId)
->withSoapLogger($this->_adwordsLogger)
->build();
$reportSelector = new Selector();
if (empty($fields))
{
$fields = array('Date', 'Clicks', 'Impressions', 'Cost',
'AveragePosition', 'Conversions', 'ConversionValue');
}
$reportSelector->setFields($fields);
if (!empty($dateFrom))
{
$dateRange = new DateRange();
$fromDate = new \Score\Time($dateFrom['mon'] . '/' .
$dateFrom['mday'] . '/' . $dateFrom['year']);
$toDate = new \Score\Time($dateTo['mon'] . '/' . $dateTo
['mday'] . '/' . $dateTo['year']);
$dateRange->setMin($fromDate->format('Ymd'));
$dateRange->setMax($toDate->format('Ymd'));
$reportSelector->setDateRange($dateRange);
}
I am having an issue trying to find the correct way to get aggregate
information for the fields:
'Date', 'Clicks', 'Impressions', 'Cost', 'AveragePosition', 'Conversions',
'ConversionValue'
I have been looking at this:
https://developers.google.com/google-ads/api/docs/reporting/example
to help me get there and although it appears to return a lot of data, it is
hard to determine exactly what it is since it comes back as the
GoogleAdsRow object. When trying to 'getSegments()' from this in order to
get the Date field, for example, the object returned is null.
Is there any resource for converting adwords reports to the Google Ads API
? Are there methods to get the Google Ads API to simply return a CSV file
of the data I'm wanting?
Help would be appreciated, thanks.
Derek
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/3bdfc1c4-bcde-47ed-b822-deeae2a40437n%40googlegroups.com.