Hello Chris,

Do you mind posting the code where you defined the data table? I am having 
trouble inserting data in the data table particularly in this step:
row[reader.Name] = reader.Value;

Would be great if you can help me.

Thanks.

On Tuesday, April 26, 2016 at 6:48:21 PM UTC+2, Chris Oh wrote:
>
> Hello, I am trying to pull in report data with the C# AdWords API in order 
> to process it for internal use. I am using AWQL to achieve this purpose. 
> For some reason, the cost data I am getting back from the API is incorrect, 
> which I think is messing up other fields I need such as CPC and CPM. 
> Following is query and the method I am using the pull in the data...
>
>
> String query = "SELECT AccountDescriptiveName, CampaignName, AdGroupName, 
> ExternalCustomerId, AdGroupStatus, " +
>                 "Clicks, Impressions, Ctr, AverageCpc, AverageCpm, Cost, 
> AveragePosition FROM ADGROUP_PERFORMANCE_REPORT " +
>                 "WHERE Impressions > 0 DURING YESTERDAY";
>
>
>
> Here, I am passing in the client that I want to pull the report from, the 
> DataTable I am trying to store my results in, and the query string defined 
> above as my parameters in the AppendToDataTable method. 
>
>
> private static void AppendToDataTable(AdWordsUser user, DataTable data, 
> String query)
>         {
>             ReportUtilities reportUtilities = new ReportUtilities(user, 
> "v201601", query,
>                 DownloadFormat.GZIPPED_XML.ToString());
>
>
>             try
>             {
>                 using (ReportResponse response = 
> reportUtilities.GetResponse())
>                 {
>                     using (GZipStream gzipStream = new 
> GZipStream(response.Stream,
>                         CompressionMode.Decompress))
>                     {
>                         using (XmlTextReader reader = new 
> XmlTextReader(gzipStream))
>                         {
>                             while (reader.Read())
>                             {
>                                 switch (reader.NodeType)
>                                 {
>                                     case XmlNodeType.Element: // The node 
> is an Element.
>                                         if (reader.Name == "row")
>                                         {
>                                             // put the row into data table
>                                             DataRow row = data.NewRow();
>                                             while 
> (reader.MoveToNextAttribute())
>                                             {
>                                                 
> //Console.Write(reader.Name + ":" + reader.Value + ", ");
>                                                 row[reader.Name] = 
> reader.Value;
>                                             }
>                                             data.Rows.Add(row);
>                                         }
>                                         break;
>                                 }
>                             }
>                         }
>                     }
>                 }
>             }
>             catch (Exception e)
>             {
>                 throw new System.ApplicationException("Failed to download 
> report.", e);
>             }
>
>         }
>
>
>  For some reason, the data I pull tells me that my cost is in the hundreds 
> of thousands just for yesterday, which can't be true, because on the 
> AdWords Console, the total cost all time is only in the thousands for that 
> client... The clicks and impression data looks correct though, it's just 
> the cost and cost related fields that are messed up for some reason. I am 
> using client library v201601 to do this. Any ideas to troubleshoot this 
> problem would be appreciated, thank you.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/9cadaad2-5afa-4182-b9c9-3ed3539967b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Re: C# AdWor... Jonathan Mallia
    • Re: C# ... 'Milind Sankeshware (AdWords API Team)' via AdWords API Forum

Reply via email to