Hi Danial, I've sent you an email. Or so I hope because I'm not sure if I got the correct mailaddress. Can you let me know that you have received it?
Op donderdag 13 september 2012 11:31:07 UTC+2 schreef Danial Klimkin het volgende: > Hello Marijn, > > > Please send me the CID of the account, XML definition for the report, and > it's full output to me *over email*. > > > -Danial, AdWords API Team. > > > On Monday, September 10, 2012 7:14:48 PM UTC+4, Marijn wrote: >> >> Hi there, >> >> We are using the .NET client library 14.7.0.0 to calculate the total >> clicks on a specific day using the AD_PERFORMANCE_REPORT. When we compare >> these results with the totals shown in the Adwords UI (Campaigns -> All >> online campaigns -> Ads) there is a difference. The cause of this >> difference is missing rows in the AD_PERFORMANCE_REPORT report. >> >> By looking at the adIDs we can figure out which ads are missing in the >> report. These ads are not any different from the ones that are present. >> We've checked stuff like AdGroup status, impressions, etc. >> >> Below is the code we use to calculate the total of clicks for yesterday >> (clicksYesterday). >> How can we find out why certain ads are missing or how to solve it? >> >> >> // Create selector >> Selector selector = new Selector(); >> selector.fields = new string[] >> { >> "AdNetworkType2", >> "AdNetworkType1", >> "AdGroupName", >> "AdGroupId", >> "AdGroupStatus", >> "Status", >> "AdType", >> "CampaignName", >> "CampaignId", >> "CampaignStatus", >> "Clicks", >> "Conversions", >> "Cost", >> "CostPerConversion", >> "AverageCpc", >> "AverageCpm", >> "CreativeDestinationUrl", >> "Description1", >> "Description2", >> "Url", >> "DisplayUrl", >> "Headline", >> "Id", >> "ImageCreativeName", >> "ImageAdUrl", >> "Impressions", >> "AveragePosition", >> "Date", >> }; >> selector.dateRange = new DateRange(); >> selector.dateRange.min = >> DateTime.Now.Date.AddMonths(-6).ToString("yyyyMMdd"); >> selector.dateRange.max = DateTime.Now.Date.ToString("yyyyMMdd"); >> >> // Add predicates >> selector.predicates = new Predicate[] { >> new Predicate() >> { >> field = "Status", >> @operator = PredicateOperator.IN, >> values = new string[] { "ENABLED", "PAUSED", "DISABLED" } >> }, >> new Predicate() >> { >> field = "AdGroupStatus", >> @operator = PredicateOperator.IN, >> values = new string[] { "ENABLED", "PAUSED", "DELETED" } >> }, >> new Predicate() >> { >> field = "CampaignStatus", >> @operator = PredicateOperator.IN, >> values = new string[] { "ACTIVE", "PAUSED", "DELETED" } >> }, >> }; >> >> // Create report definition >> ReportDefinition reportDefinition = new ReportDefinition(); >> reportDefinition.reportName = "Test - Creative performance report"; >> reportDefinition.dateRangeType = >> ReportDefinitionDateRangeType.CUSTOM_DATE; >> reportDefinition.reportType = >> ReportDefinitionReportType.AD_PERFORMANCE_REPORT; >> reportDefinition.downloadFormat = DownloadFormat.XML; >> reportDefinition.selector = selector; >> reportDefinition.includeZeroImpressions = true; >> >> // Download the report >> ReportUtilities reportUtilities = new ReportUtilities(this.User); >> reportUtilities.ReportVersion = "v201206"; >> reportUtilities.DownloadClientReport(reportDefinition, >> @"c:\temp\adperformance.xml"); >> >> // Extract ids >> List<long> adIdsYesteday = new List<long>(); >> long clicksYesterday = 0; >> using (FileStream fileStream = new >> FileStream(@"c:\temp\adperformance.xml", FileMode.Open)) >> { >> using (XmlReader xmlReader = XmlReader.Create(fileStream)) >> { >> xmlReader.MoveToContent(); >> while (xmlReader.Read()) >> { >> // Handle each 'row' >> if (xmlReader.Name == "row") >> { >> // Get values >> XElement rowNode = (XElement)XElement.ReadFrom(xmlReader); >> long adId = long.Parse(rowNode.Attribute("adID").Value); >> DateTime adDate = >> DateTime.ParseExact(rowNode.Attribute("day").Value, "yyyy-MM-dd", >> CultureInfo.InvariantCulture); >> long adClicks = >> long.Parse(rowNode.Attribute("clicks").Value); >> >> // Handle data for yesterday >> if (adDate == DateTime.Now.Date.AddDays(-1)) >> { >> clicksYesterday += adClicks; >> adIdsYesteday.Add(adId); >> } >> } >> } >> } >> } >> >> // Store adIDs >> using (FileStream fs = new FileStream(@"c:\temp\ids.txt", >> FileMode.Create)) >> using (StreamWriter sw = new StreamWriter(fs)) >> foreach (string s in adIdsYesteday.Select(id => id.ToString())) >> sw.WriteLine(s); >> > -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en