Important : Few queries regarding Google Ads APIs

92 views
Skip to first unread message

sumitray raj

unread,
Jun 23, 2021, 1:22:56 AM6/23/21
to AdWords API and Google Ads API Forum
Hi Team,
              We are currently working on a project where we are integrating a component with Google Ads API. There are few queries that we had regarding the same.

1) We are looking for an API Endpoint where we can check the current status of an Ad in terms of it's "approval" and "disapproval" or "approved with limitation" status. Currently we have found one solution which is given at this reference link : https://developers.google.com/google-ads/api/reference/rpc/v8/AdGroupAdPolicySummary. we are checking the approval_status in the above link.

We are also trying the below query to fetch the current status of an Ad : 
The below query currently fetching all the disapproved ads for the given ad campaign.
string searchQuery = $@"
                SELECT
                    ad_group_ad.ad.id,
                    ad_group_ad.ad.type,
                    ad_group_ad.policy_summary.approval_status,
                    ad_group_ad.policy_summary.policy_topic_entries
                FROM ad_group_ad
                WHERE
                    campaign.id = {campaignId}
                    AND ad_group_ad.policy_summary.approval_status = DISAPPROVED";

  Could you please let us know if the above approach is correct ? Also If you could tell us if there are any better alternatives to the one mentioned above.

2) We are also trying to create an ImageAd where we are stuck in providing the media_file_Id. 
     customers/{customer_id}/mediaFiles/{media_file_id}

Below we are not sure what should be the value of media_file_id when we are initializing the MediaFile Property of ImageAd Object.

            AdGroupAd adGroupAd = new AdGroupAd
                {
                    AdGroup = ResourceNames.AdGroup(customerId, adGroupId),
                    // Optional: Set the status.
                    Status = AdGroupAdStatus.Paused,
                    Ad = new Ad
                    {
                        Name = "Image Ad KFC",
                        FinalUrls = { "http://www.example.com/" + i },
                        ImageAd = new ImageAdInfo
                        {
                            Name = "KFC Ad with Image Wow!",
                            ImageUrl = "https://image.shutterstock.com/image-vector/sample-stamp-grunge-texture-vector-260nw-1389188336.jpg",
                            PixelHeight = 300,
                            PixelWidth = 400,
                            MediaFile = $"customers/{customerId}/mediaFiles/{media_file_id}"
                        },
                        DisplayUrl = "http://www.example.com/" + i,
                    }
                };



3) We are also trying to target Ads using the location component of Google Ads. For that we are currently using the below code(C#), where we Must provide a "location Id" that we get from this Reference : https://developers.google.com/google-ads/api/reference/data/geotargets. But when we see the UI on Google Ads Account, there we can mention a country, city, region or PostCode. I am also attaching a screenshot for the reference. How Exactly could we achieve the same thing via the API?
 
        return new CampaignCriterion()
            {
                Campaign = campaignResourceName,
                Location = new LocationInfo()
                {
                    GeoTargetConstant = location.ToString()
                }
            };


Please let me know if you require anything else from our side. Eagerly waiting for your response.

Thanks and Regards,
Sumit Rayakwar
GoogleLocationTargetting.PNG

Google Ads API Forum Advisor

unread,
Jun 25, 2021, 1:27:30 PM6/25/21
to suma...@gmail.com, adwor...@googlegroups.com
Hello,

Thanks for reaching out. Please see my replies to each of your inquiries in order:
  1. Yes, this is the correct approach. The policy_summary.approval_status attribute is used to fetch the approval status of an entity. 
  2. ImageAdInfo accepts a MediaFile resource. The media file ID can be found here.
  3. You can use GeoTargetConstantService.SuggestGeoTargetConstants to look up locations by name. Please see this guide and code example.
Please let us know if you have any further questions.

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2IxyRm:ref
Reply all
Reply to author
Forward
0 new messages