Hello Anthony,
I'm already looping through them, Here is the full code:
String query = "SELECT ad_group.id, "
+ "ad_group_ad.ad.id, "
+ "ad_group_ad.ad.name," +
" ad_group_ad.ad.type, " +
"ad_group_ad.ad.shopping_product_ad " +
" FROM ad_group_ad " +
"Where ad_group_ad.ad.type = \"SHOPPING_PRODUCT_AD\" ";
GoogleAdsServiceClient.SearchPagedResponse response =
this.ExecuteGoogleAdsQuery(query, customerId);
JsonArray entryList = new JsonArray();
JsonObject entry = null;
for (GoogleAdsRow googleAdsRow : response.iterateAll()) {
entry = new JsonObject();
AdGroupAd adGroupAd =googleAdsRow.getAdGroupAd();
Ad ad = adGroupAd.getAd();
ShoppingProductAdInfo shoppingProductAd = ad.getShoppingProductAd();
ExpandedTextAdInfo expandedTextAdInfo = ad.getExpandedTextAd();
Campaign campaign = googleAdsRow.getCampaign();
AdGroup adGroup = googleAdsRow.getAdGroup();
Metrics metrics = googleAdsRow.getMetrics();
entry.addProperty("id", ad.getId().getValue());
entry.addProperty("name",ad.getName().getValue());
entry.addProperty("type",ad.getType().toString());
entry.addProperty("campaign",adGroup.getCampaign().getValue());
entry.addProperty("shopping_product_ad",shoppingProductAd.getAllFields().toString());
entryList.add(entry);
}
Would you be able to help with this?
Thank you!
On Wed, Aug 19, 2020 at 1:50 PM Google Ads API Forum Advisor Prod <
[email protected]> wrote:
> Hello Ahmed,
>
> Instead of using an AdGroupAd object, you should iterate through the rows
> in your report, much like how it is shown here
> <https://developers.google.com/google-ads/api/docs/samples/get-expanded-text-ads>
> .
>
> Regards,
> Anthony
> Google Ads API Team
>
> ref:_00D1U1174p._5004Q23LHe7: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 [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
"AdWords API and Google Ads 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/CAP2chZpHREFUtYLBVzFkYaNk4LvNuGRTWKik9%2BkThZC4X2gtBw%40mail.gmail.com.