I want to get Device Targeting Information from Google Ads Api as show in below screen shot:

Currently from what i get from the documentation i am doing this :

string  query = $@"SELECT campaign_criterion.device.type FROM campaign_criterion";       // also tried this query query = $@"SELECT campaign.id, campaign_criterion.device. FROM Device WHERE campaign.id =           {campaignId}";            PagedEnumerable<SearchGoogleAdsResponse, GoogleAdsRow> result =               googleAdsService.Search(customerId.ToString(), query);            foreach (GoogleAdsRow criterionRow in result)             {                 DeviceInfo device = criterionRow.CampaignCriterion.Device;             } 

I have randomly tried many other but i always see NULL in Device i have been able to successfully get Keywords , Ad Schedule View and works fine but cannot seem to get this working any help is appreciated.

Tag:google-ads-api, c#

Only one comment.

  1. confusedMind

    This is what i needed :

    query = @"SELECT campaign.name, campaign.status, segments.device, metrics.impressions, metrics.clicks, metrics.ctr, metrics.average_cpc, metrics.cost_micros FROM campaign WHERE segments.date = '2020-11-11'";

Add a new comment.