Not Getting proper value from cost column

38 views
Skip to first unread message

Pravin Yadav

unread,
Jul 20, 2015, 8:45:22 AM7/20/15
to adwor...@googlegroups.com
Hi,

     We had retrieved all data reports of Google AdWords but all of the report data of Cost column is not getting proper data/value.

     As in  our AdWords Account data is shown as  12.4 for cost column but while retrieving we are getting it as 234000 which is large enough.

    Below is the code sample of report data retrieved :-

     if (getIndex == "Account_Performance_Report")
                        {
                            #region ACCOUNT_PERFORMANCE_REPORT
                            ConfigureUserForOAuth();

                            ReportDefinition definition = new ReportDefinition();


                            definition.reportName = "ALL_TIME ACCOUNT_PERFORMANCE_REPORT";
                            definition.reportType = ReportDefinitionReportType.ACCOUNT_PERFORMANCE_REPORT;
                            definition.downloadFormat = DownloadFormat.XML;
                            definition.dateRangeType = ReportDefinitionDateRangeType.ALL_TIME;

                            // Create selector.
                            Selector selector = new Selector();
                            //selector.fields = new string[] { "CampaignId", "CampaignName", "CampaignStatus", "Clicks", "Impressions", "Cost", "Ctr", "ClickConversionRate" };
                            selector.fields = new string[] { "AccountCurrencyCode","AccountDescriptiveName","AccountTimeZoneId","AdNetworkType1",
                                                         "AdNetworkType2","AverageCpc","AverageCpm","AveragePosition","CanManageClients","ClickConversionRate","Clicks",                                                         
                                                         "ConversionRateManyPerClick","ConversionValue","ConversionsManyPerClick",
                                                         "ConvertedClicks","Cost","CostPerConversionManyPerClick","CostPerConvertedClick","Ctr",
                                                         "CustomerDescriptiveName","Date","DayOfWeek","Device","EstimatedCrossDeviceConversions","EstimatedTotalConversionRate",
                                                         "EstimatedTotalConversionValue","EstimatedTotalConversionValuePerClick","EstimatedTotalConversionValuePerCost",
                                                         "EstimatedTotalConversions","ExternalCustomerId","Impressions","InvalidClickRate","InvalidClicks",
                                                         "IsAutoTaggingEnabled","IsTestAccount","Month","MonthOfYear","PrimaryCompanyName","Quarter","SearchBudgetLostImpressionShare",
                                                         "SearchExactMatchImpressionShare","SearchImpressionShare","SearchRankLostImpressionShare",
                                                         "ValuePerConversionManyPerClick","ValuePerConvertedClick","ValuePerEstimatedTotalConversion","ViewThroughConversions",
                                                         "Week","Year" };

                            (user.Config as AdWordsAppConfig).ClientCustomerId = txtCustomerId;
                            //if (Session["OAuthProvider"] != null)
                            //{

                            //Predicate predicate = new Predicate();
                            //predicate.field = "AccountDescriptiveName";
                            //predicate.@operator = PredicateOperator.IN;
                            //predicate.values = new string[] { "PAUSED", "ENABLED" };
                            //selector.predicates = new Predicate[] { predicate };



                            definition.selector = selector;
                            definition.includeZeroImpressions = true;


                            string filePath = Path.GetTempFileName();
                            string tgrfilePath = Server.MapPath(@"~/FileUpload/");
                            // string filePath = @"~\UploadExcel\";
                            //string Newfile;

                            ReportUtilities utilities = new ReportUtilities(user, "v201502", definition);

                            try
                            {
                                using (ReportResponse response = utilities.GetResponse())
                                {
                                    response.Save(filePath);
                                }  
                         }
                    }

             If any solution regarding the above mentioned problem please help on early basis.


             For reference have a glance at the attached file.


Please reply as early as possible.   
Untitled.jpeg

Anthony Madrigal

unread,
Jul 20, 2015, 12:22:52 PM7/20/15
to adwor...@googlegroups.com, yadav.p...@gmail.com
Hi Pravin,

The field Cost is of type Money. The type Money will return your values in micro-units. For example, $1.00 will return as 1,000,000 micro-units.

If you are getting some discrepancies with the values of your UI and API report, please Reply privately to author your SOAP request and response and a screenshot of your UI.

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