Get cost or other values from Ad object

24 views
Skip to first unread message

goo...@gruener-fisher.de

unread,
Jan 12, 2016, 8:56:44 AM1/12/16
to AdWords API Forum
I would like to know how you can get the cost for an Ad or other values from like an TextAd object.

Since the TextAd.Fields doesn't include that, is there a way I can get this from a different object, so I can include that in the fields Selector?

Or which docu would I have to check to find info about that?

From the sample code:
// Create a selector.
            Selector selector = new Selector()
            {
                fields = new string[] { TextAd.Fields.Id, AdGroupAd.Fields.Status, TextAd.Fields.Headline, TextAd.Fields.Description1, TextAd.Fields.Description2, TextAd.Fields.DisplayUrl  },  //which object do I need to get cost for Ad
                ordering = new OrderBy[] { OrderBy.Asc(TextAd.Fields.Id) },
                predicates = new Predicate[] {
                  // Restrict the fetch to only the selected ad group id.
                  Predicate.Equals(AdGroupAd.Fields.AdGroupId, adGroupId),

                  // Retrieve only text ads.
                  Predicate.Equals("AdType", "TEXT_AD"),

                  // By default disabled ads aren't returned by the selector. To return
                  // them include the DISABLED status in the statuses field.
                  Predicate.In(AdGroupAd.Fields.Status, new string[] { AdGroupAdStatus.ENABLED.ToString(), AdGroupAdStatus.PAUSED.ToString(), AdGroupAdStatus.DISABLED.ToString()
                  })
                },
                paging = Paging.Default
            };

Thanks

Anthony Madrigal

unread,
Jan 12, 2016, 11:12:48 AM1/12/16
to AdWords API Forum
Hi,

Unfortunately, the only way to get stats such as Cost is through reporting. For your use case, you should use the Ad Performance Report.

Regards,
Anthony
AdWords API Team
Reply all
Reply to author
Forward
0 new messages