how to get ad_group_ad_asset_view use php

99 views
Skip to first unread message

王众杰

unread,
Mar 30, 2020, 5:11:10 AM3/30/20
to AdWords API and Google Ads API Forum

Question 1:  I can get data  from CAMPAIGN_PERFORMANCE_REPORT but ADGROUP_PERFORMANCE_REPORT get null

"SELECT AccountCurrencyCode, AccountTimeZone, CampaignId, ConversionRate, Ctr, Conversions, AverageCpm, Impressions, Clicks, Cost, AverageCpm, Date FROM CAMPAIGN_PERFORMANCE_REPORT DURING 20200315,20200315"

VS

"SELECT ExternalCustomerId, AccountCurrencyCode, CampaignId, AdGroupId, Clicks, Conversions, Cost, Impressions, Interactions, AverageCpm, Date FROM ADGROUP_PERFORMANCE_REPORT DURING 20200315,20200330"


Question 2: 
Now I want to use "googleads/googleads-php-lib""^44.0" to get ad_group_ad_asset_view like this, this i do not know hou to get this data use php libary. 企业微信截图_69b0636b-5bd9-4ed2-8b9e-2a9c98318df7.png



POST /api/adwords/reportdownload/v201809 HTTP/1.1
Host: adwords.google.com
User-Agent: shiyue (AwApi-PHP, googleads-php-lib/44.0.0, PHP/7.1.29, GuzzleHttp/6.5.1, curl/7.64.1, ReportQueryBuilder)
Authorization: Bearer xxxxxxx
developerToken: xxxxx
clientCustomerId: 9747393345
skipReportHeader: false
skipColumnHeader: false
skipReportSummary: false
useRawEnumValues: false
includeZeroImpressions: true
Cache-Control: no-cache
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="__rdquery"

SELECT metrics.clicks,metrics.conversions,metrics.impressions,asset.name,asset.text_asset.text,asset.youtube_video_asset.youtube_video_id,campaign.name,segments.date FROM ad_group_ad_asset_view WHERE segments.date DURING 20200301,20200315
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="__fmt"

XML
------WebKitFormBoundary7MA4YWxkTrZu0gW--
在此输入代码...

POST /api/adwords/reportdownload/v201809 HTTP/1.1
User-Agent: shiyue (AwApi-PHP, googleads-php-lib/44.0.0, PHP/7.1.29, GuzzleHttp/6.5.1, curl/7.64.1, ReportQueryBuilder)
Authorization: Bearer ya29.a0Adw1xeUiMjDaHRHaCfOBjBh6aLJUftUt1vODF2Ee8EoU7zJX4u6Vwn73h6WTdLolApKokO2rUFcONrtAdhFauxQo_nmwyMnXMl_srjpiviM4RXAWKMYC747qLsJRiQuX_aypZWi4rw7hwKgT1UGz39jcZ_j5bssNK0cM
developerToken: 
clientCustomerId: 9747393345
skipReportHeader: false
skipColumnHeader: false
skipReportSummary: false
useRawEnumValues: false
includeZeroImpressions: true
Cache-Control: no-cache
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="__rdquery"

SELECT metrics.clicks,metrics.conversions,metrics.impressions,asset.name,asset.text_asset.text,asset.youtube_video_asset.youtube_video_id,campaign.name,segments.date FROM ad_group_ad_asset_view WHERE segments.date DURING 20200301,20200315
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="__fmt"

XML
------WebKitFormBoundary7MA4YWxkTrZu0gW--


Google Ads API Forum Advisor Prod

unread,
Mar 30, 2020, 11:37:20 AM3/30/20
to baidush...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out. The reason that you are unable to get ad group metrics for your campaigns is because the API only supports campaign level reporting for App Campaigns as explained here.

For the report, you can follow this example but replace the query with your desired values.

Regards,
Mitchell
Google Ads API Team

ref:_00D1U1174p._5001UZV86Q:ref

王众杰

unread,
Mar 30, 2020, 11:54:52 PM3/30/20
to AdWords API and Google Ads API Forum
how about https://developers.google.com/google-ads/api/fields/v2/ad_group_ad_asset_view ,my ads are UAC,we want get report like this 

企业微信截图_69b0636b-5bd9-4ed2-8b9e-2a9c98318df7.png
在 2020年3月30日星期一 UTC+8下午11:37:20,adsapiforumadvisor写道:

Google Ads API Forum Advisor Prod

unread,
Mar 31, 2020, 10:57:22 AM3/31/20
to baidush...@gmail.com, adwor...@googlegroups.com
Hi,

You can get ad group-level reporting for the individual assets comprising the ad by following this guide. If you are having trouble retrieving specific metrics, please share them in English along with your client customer ID so I can further investigate the issue.

jeski zhao

unread,
Apr 29, 2020, 4:12:06 AM4/29/20
to AdWords API and Google Ads API Forum
Hi  adsapiforumadvisor:
     I want get the asset performances. I tried using the ad_group_ad_asset_view as you suggest. But there is a problem, I can't get the asset name. Can you help me ?   Here is the main code:
     
$query =
           "SELECT
               campaign.id,
               campaign.name,
               ad_group.id,
               ad_group.name,
               ad_group_ad.ad.id,
               ad_group_ad.ad.type,
               ad_group_ad.ad.name,
               asset.id,
               asset.name,
               asset.type,
               asset.resource_name,
               metrics.impressions,
               metrics.clicks,
               metrics.cost_micros,
               metrics.conversions,
               segments.date
           FROM ad_group_ad_asset_view
           WHERE segments.date BETWEEN '{$beginTime}' AND '{$endTime}'
           AND metrics.impressions > 0
           ORDER BY ad_group_ad_asset_view.performance_label";
           
$asset = $googleAdsRow->getAsset();
$assetId = $asset->getIdUnwrapped();
$assetName = $asset->getNameUnwrapped();
$assetType = $asset->getType();



在 2020年3月31日星期二 UTC+8下午10:57:22,adsapiforumadvisor写道:
Reply all
Reply to author
Forward
0 new messages