Google Adwords API response parse

Posted by Yun Ling on Stack Overflow See other posts from Stack Overflow or by Yun Ling
Published on 2012-12-08T04:58:39Z Indexed on 2012/12/08 5:04 UTC
Read the original article Hit count: 240

Filed under:
|

I am trying to figure out how to parse the Adword API query response without exceptions and one issue that i came across is that sometimes, the data itself contains comma besides the comma between each column. Say i do a query on Adroup, campaign and impression by using

<reportDefinition xmlns="https://adwords.google.com/api/adwords/cm/v201209">
  <selector>
    <fields>CampaignName</fields>
    <fields>AdgroupName</fields>
    <fields>Impressions</fields>
    <predicates>
      <field>Status</field>
      <operator>IN</operator>
      <values>ENABLED</values>
      <values>PAUSED</values>
    </predicates>
  </selector>
  <reportName>Custom Adgroup Performance Report</reportName>
  <reportType>ADGROUP_PERFORMANCE_REPORT</reportType>
  <dateRangeType>LAST_7_DAYS</dateRangeType>
  <downloadFormat>CSV</downloadFormat>
</reportDefinition>

Since my campaign has comma within the string like below: "Adroup,Campaign,Impressions, Premiun Beer, Beer, Chicago, 1000" where the adgroup is "premium beer" and campaign is "Beer,Chicago". that will cause an issue if we parse this information by using comma. Does anyone know how to solve this problem?

© Stack Overflow or respective owner

Related posts about c#

Related posts about google-adwords-api