Hi,

 

I have downloaded the Geo database from the below link and trying update
geo target of my campaigns using  java v200906 api. 

 Every  time I got the '[Target Error.INVALID CITY_CODE]'. I have tried
with different countries and cities but got same error.

 

Link :
http://code.google.com/p/google-api-adwords-java/source/browse/trunk#tru
nk/data

 

Please let me know If I am doing anything wrong.

 

Part of my  code :

 

CityTarget cityTarget = new CityTarget();

cityTarget.setCountryCode("US");

cityTarget.setProvinceCode("AL");

cityTarget.setCityName("Alabama");

List<GeoTarget> geoTargets = new ArrayList<GeoTarget>();

geoTargets.add(cityTarget);

 

GeoTargetList geoTargetList = new GeoTargetList();

geoTargetList.setTargets(geoTargets.toArray(new GeoTarget[] {}));

geoTargetList.setCampaignId(campaignInfo.getNetworkMapingInfo().getNetwo
rkEntityId());

 

 CampaignTargetOperation geoTargetOperation = new
CampaignTargetOperation();

   geoTargetOperation.setOperand(geoTargetList);            

    geoTargetOperation.setOperator(Operator.SET);

                                

AdWordsUser user = new AdWordsUser("propertiesfile");

CampaignTargetServiceInterface  campaignTargetServiceInterface =
user.getService(AdWordsService.V200906.CAMPAIGN_TARGET_SERVICE);

 

          try {

                campaignTargetServiceInterface.mutate(new
CampaignTargetOperation[] {geoTargetOperation });

            } catch (ApiException e) {

                logger.error("ApiException Unable to update Campaigns
Targets "+ e);

                

            } catch (RemoteException e) {

                logger.error("updateTargets: RemoteException Unable to
update Campaigns Targets "+ e);

                

            }

 

 

 

Thanks & Regards,

Sreenu Daram ,  Sr. Software Engineer

Cybage Software Pvt. Ltd. (An SEI-CMMI Level 5 assessed & ISO 27001
Company ),

Hyderabad, India

Phone(O) : 91-40-66294100 Ext:4047

Mobile:91-9949918983

 


"Legal Disclaimer: This electronic message and all contents contain information 
from Cybage Software Private Limited which may be privileged, confidential, or 
otherwise protected from disclosure. The information is intended to be for the 
addressee(s) only. If you are not an addressee, any disclosure, copy, 
distribution, or use of the contents of this message is strictly prohibited. If 
you have received this electronic message in error please notify the sender by 
reply e-mail to and destroy the original message and all copies. Cybage has 
taken every reasonable precaution to minimize the risk of malicious content in 
the mail, but is not liable for any damage you may sustain as a result of any 
malicious content in this e-mail. You should carry out your own malicious 
content checks before opening the e-mail or attachment."
www.cybage.com 



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to