Hi All,
I have achieved my objective, here is final code.
try
{
List<TargetList> targetList = new
List<TargetList>();
PlatformTarget pt = new PlatformTarget();
pt.platformTypeSpecified = true;
pt.platformType = PlatformType.DESKTOP;
NetworkTarget nt = new NetworkTarget();
nt.networkCoverageTypeSpecified = true;
nt.networkCoverageType =
NetworkCoverageType.GOOGLE_SEARCH;
NetworkTarget nt1 = new NetworkTarget();
nt1.networkCoverageTypeSpecified = true;
nt1.networkCoverageType =
NetworkCoverageType.SEARCH_NETWORK;
NetworkTargetList newtworkTargetList = new
NetworkTargetList();
newtworkTargetList.campaignIdSpecified =
true;
newtworkTargetList.campaignId =
campRes.id;
newtworkTargetList.targets = new
NetworkTarget[] { nt, nt1 };
targetList.Add(newtworkTargetList);
PlatformTargetList platformTargetList =
new PlatformTargetList();
platformTargetList.campaignIdSpecified =
true;
platformTargetList.campaignId =
campRes.id;
platformTargetList.targets = new
PlatformTarget[] { pt };
targetList.Add(platformTargetList);
List<CampaignTargetOperation>
targetOperation = new List<CampaignTargetOperation>();
foreach (TargetList s in targetList)
{
CampaignTargetOperation cto = new
CampaignTargetOperation();
cto.operatorSpecified = true;
cto.@operator = Operator.SET;
cto.operand = s;
targetOperation.Add(cto);
}
CampaignTargetService targetService =
(CampaignTargetService)user.GetService(AdWordsService.v200909.CampaignTargetService);
targetService.mutate(targetOperation.ToArray());
}
catch (Exception exc)
{ ;}
On Feb 23, 1:01 pm, Tanveer <[email protected]> wrote:
> Hi All,
>
> I am using NetworkTarget and PlatformTarget at the time when, creating
> a campaign, here is the code
>
> PlatformTarget pt = new PlatformTarget();
> pt.platformTypeSpecified = true;
> pt.platformType = PlatformType.DESKTOP;
>
> NetworkTarget nt = new NetworkTarget();
> nt.networkCoverageTypeSpecified = true;
> nt.networkCoverageType =
> NetworkCoverageType.GOOGLE_SEARCH;
>
> But I am not able to figure out that how i can associate this code
> with campaign.
>
> If is there anybody who is aware please help, my preferred language is
> C#.
>
> Tanveer
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en