Anash,
I don't know if I was wrong, but I want to clarify the situation:
-with API v200909:
LanguageTargetList languageTargetList = new
LanguageTargetList();
.....
GeoTargetList geoTargetList = new GeoTargetList();
...
TargetList[] targets = new TargetList[]
{ languageTargetList, geoTargetList };
System.Collections.ArrayList campaignTargetOperations
= new System.Collections.ArrayList();
foreach (TargetList target in targets)
{
CampaignTargetOperation ops = new
CampaignTargetOperation();
ops.operatorSpecified = true;
ops.@operator = Operator.SET;
ops.operand = target;
campaignTargetOperations.Add(ops);
}
According to that code, even if how many languages and geo
points, when I add them to TargetList array, I have only 2 operations.
- With the new API:
Since the new API does not support anything than
AdScheduleTargetList, I have to update a lot of criteria but no way to
use SET operator.
int allTargets = ...;
CampaignCriterion[] criteria = new
CampaignCriterion[allTargets];
foreach(...)
{
...
}
List<CampaignCriterionOperation> operations = new
List<CampaignCriterionOperation>();
foreach (CampaignCriterion criterion in criteria)
{
CampaignCriterionOperation operation = new
CampaignCriterionOperation();
operation.@operator = Operator.ADD;
operation.operand = criterion;
operations.Add(operation);
}
For example, if I have 1 language criterion and 300
location criteria, so I'll have 301 operations? I think that was the
reason I got the error EntityCountLimitExceeded.CAMPAIGN_LIMIT but I
don't know how to solve the problem.
The above code was written based on
AddCampaignTargetingCriteria.cs in v201109 package samples.
On Dec 30, 9:52 am, Minh Le <[email protected]> wrote:
> Hi Anash,
>
> Did you mean I have to remove all the old criteria before adding the
> new one? How to know which one is unwanted? For each campaign, I have
> over 100 proximity criteria and over 200 location criteria. I run a
> timing schedule to update the campaign hourly.
>
> I did tried to do the removing; however, I got the error messages in
> the SOAP response which asked me to provide the id for each criterion,
> but I didn't know how to get it.
>
> On Dec 30, 4:45 am, "Anash P. Oommen" <anash.p.oommen
>
>
>
>
>
>
>
> [email protected]> wrote:
> > Hi Roger,
>
> > Yes, unlike v201101, v201109 doesn't provide an option to overwrite the old
> > criterion using the SET operator. You have to REMOVE the unwanted ones and
> > ADD the new ones. I'll ask our team to clarify this in the docs.
>
> > Hi Minh Li,
>
> > Are you getting this error even after deleting the campaign criterion you
> > no longer need?
>
> > Cheers,
> > Anash P. Oommen,
> > AdWords API Advisor.
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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