getting language codes and country codes for CampaignRequest

37 views
Skip to first unread message

dotnetprogrammer

unread,
Aug 9, 2005, 6:40:26 PM8/9/05
to AdWords API Forum
Hi,

I'm creating a CampaignRequest object for the Traffic Estimator
service. I'm going to allow the user to select the languages and
geoTarget information from controls such as combo boxes (im using
VB.NET), however i'm unsure on how i can get the data for the
languages? for example, do i manually need to populate my controls with
the language codes? or is there some programmable way of accessing this
data...?

I need data for the language codes and the country codes.

Thanks.

Patrick Chanezon

unread,
Aug 10, 2005, 5:57:05 AM8/10/05
to dotnetprogrammer, AdWords API Forum
Hi dotnetprogrammer,
all language and country codes are described at
http://www.google.com/apis/adwords/developer/adwords_api_geotarget.html
These give you the codes and labels for your dialog boxes.

There is no programmable way to get this data from our side, which
makes sense since these are constants and not subject to change (for
the time scales we're interested in, 10 years: I don't want to reopen
the "end of history" debate from a few years ago, I haven't read nor
endorse Fukuyama :-)

So you can populate your dialog boxes with these hardcoded values that
you can find on the web site without any remorse:-)

Do such prepopulated boxes exist in VB.NET? I don't think so but that
would be a nice open source project to create:-)
In the java open source client library for Adwords that we released a
few months ago, http://www.google.com/apis/adwords/javaclient.html,
there are no enumeration defined for these types (from
CampaignServiceDemo.java in that project).

// Target the campaign at France and Spain.
// Only one kind of geotargeting can be specified.
GeoTarget g_target = new GeoTarget();
String[] countries = {"FR", "ES"};
// g_target.setRegions(regions);
g_target.setCountries(countries);
newCampaign.setGeoTargeting(g_target);

// Target the campaign at English, French and Spanish.
LanguageTarget l_target= new LanguageTarget();
String[] languages = {"en", "fr", "es"};
l_target.setLanguages(languages);
newCampaign.setLanguageTargeting(l_target);

I hope this helps.

P@
--
-- Patrick Chanezon, AdWords API evangelist
http://blog.chanezon.com/
http://www.google.com/apis/adwords/

dotnetprogrammer

unread,
Aug 10, 2005, 7:29:21 AM8/10/05
to AdWords API Forum
Thanks patrick 8)

Reply all
Reply to author
Forward
0 new messages