Add list ipAddress Exclusions to campaign

6 views
Skip to first unread message

Huy Nguyễn Văn

unread,
Aug 9, 2016, 3:13:54 AM8/9/16
to AdWords API Forum
I have list Campaign and list IP

I want add list IP for each campaign ?

 Selector selector = new Selector() {
        fields
= new string[] { Campaign.Fields.Id, Campaign.Fields.Name, Campaign.Fields.Status },
        ordering
= new OrderBy[] { OrderBy.Asc(Campaign.Fields.Name) }
     
};


     
(user.Config as AdWordsAppConfig).ClientCustomerId = txtCustomerId.Text;


     
try {
       
CampaignService service =
           
(CampaignService) user.GetService(AdWordsService.v201601.CampaignService);


       
CampaignPage page = service.get(selector);


       
// Display campaigns.
       
if (page != null && page.entries != null && page.entries.Length > 0) {
         
DataTable dataTable = new DataTable();
          dataTable
.Columns.AddRange(new DataColumn[] {
             
new DataColumn("Serial No.", typeof(int)),
             
new DataColumn("Campaign Id", typeof(long)),
             
new DataColumn("Campaign Name", typeof(string)),
             
new DataColumn("Status", typeof(string))
         
});
         
for (int i = 0; i < page.entries.Length; i++) {
           
Campaign campaign = page.entries[i];
           
DataRow dataRow = dataTable.NewRow();
            dataRow
.ItemArray = new object[] {i + 1, campaign.id, campaign.name,
                campaign
.status.ToString()
           
};
            dataTable
.Rows.Add(dataRow);

             
// add list 
ipAddress Exclusions  to campaign ?


         
}

         
CampaignGrid.DataSource = dataTable;
         
CampaignGrid.DataBind();
       
} else {
         
Response.Write("No campaigns were found.");
       
}
     
} catch (Exception e) {
       
Response.Write(string.Format("Failed to get campaigns. Exception says \"{0}\"",
            e
.Message));
     
}
   
}




Please!
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages