Create campaign with topics

129 views
Skip to first unread message

di...@algomizer.com

unread,
May 19, 2016, 2:43:45 AM5/19/16
to AdWords API Forum
how to create campaign with topics ?

when I am creating campaign like described:


I want to add topics:

            Vertical vertical = new Vertical();
            vertical.path = new[] {"Hobbies & Leisure", "Outdoors", "Hiking & Camping"};

where I should add vertical to campaign or how I can relate vertical to campaign and mutate this operation  ?


Peter Oliquino

unread,
May 19, 2016, 2:28:20 PM5/19/16
to AdWords API Forum
Hi,

Unfortunately, Verticals have been deprecated and are no longer supported in the API. As a workaround, you can use the Affinity or In-Market categories instead. 

Please note that these criterion can only be excluded on the campaign level. You can add them on the ad group level. Please see this chart as a reference. You can add these using the AdGroupCriterionService.

Regards,
Peter
AdWords API Team

di...@algomizer.com

unread,
May 20, 2016, 10:28:34 AM5/20/16
to AdWords API Forum
Hi,
Can You please write example that shows where I cat set: path = new[] {"Hobbies & Leisure", "Outdoors", "Hiking & Camping"};
I need an code example that shows how can I set adgroup topics through API

Thank You.

Peter Oliquino

unread,
May 20, 2016, 4:17:14 PM5/20/16
to AdWords API Forum
Hi,

You could refer to the below sample code :

   CriterionUserInterest userInterest = new CriterionUserInterest();
    userInterest
.setUserInterestId(80429L);  // this will be the id field found in the  Affinity or In-Market categories
   
   
BiddableAdGroupCriterion userInterestBiddableAdGroupCriterion1 = new BiddableAdGroupCriterion();
    userInterestBiddableAdGroupCriterion1
.setAdGroupId(adGroupId);
    userInterestBiddableAdGroupCriterion1
.setCriterion(userInterest);
   
   
AdGroupCriterionOperation adGroupCriterionOperation1 = new AdGroupCriterionOperation();
    adGroupCriterionOperation1
.setOperand(userInterestBiddableAdGroupCriterion1);
    adGroupCriterionOperation1
.setOperator(Operator.ADD);
   
   
AdGroupCriterionOperation[] operations =
           
new AdGroupCriterionOperation[] {adGroupCriterionOperation1
               
};
     

   
AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations);

Borislav Hristov

unread,
Nov 3, 2016, 1:37:19 PM11/3/16
to AdWords API Forum

Hi Peter, 
I've just managed to create Verticals as a BiddableAdGroupCriterion for a Display Network Campaign via API(setting all topics.And I can see in the AdWords accoutn UI that the changes took effect.We're using the v201609 API version(on LIVE acount, not test).
And I'm really wondering what do you mean when you say this functionallity is depricated - you mean it will be depricated in the near future or waht...?
Here is a code snippet from my API call using .NET client library

                var topicsCriterion = new Vertical();
                topicsCriterion.verticalId = 4;

                // create AdGroupCriterion;
                var adGroupCriterion = new BiddableAdGroupCriterion();
                adGroupCriterion.adGroupId = existingAdGroupId;
                adGroupCriterion.criterion = topicsCriterion;
                adGroupCriterion.criterion.type = CriterionType.VERTICAL;

                // create adgroupcriterion operaion
                var operation = new AdGroupCriterionOperation();
                operation.operand = adGroupCriterion;
                operation.@operator = Operator.ADD;

var service = AdwordsAuthotication.GetAdGroupCriterionService(clientID);
            var returnValue = service.mutate(operation);

Best regards,
Borislav Hristov




Peter Oliquino

unread,
Nov 3, 2016, 11:15:09 PM11/3/16
to AdWords API Forum
Hi Borislav,

Thank you for your question. However, as this is already an old thread, could you create a new one containing your concern? We'll continue our discussion from there.

Thanks and regards,
Peter
AdWords API Team 
Reply all
Reply to author
Forward
0 new messages