Avatar of Pedro Chagas
Pedro ChagasFlag for Portugal

asked on 

Return results from two countrys in Adwords API

Hi E's, For get relation keywords I use Adwords API.
========================
# Create seed keyword structure.
$seed_keyword =
  '<negative>false</negative>' .
  '<text>'.$wordforapi.'</text>' .
  '<type>Exact</type>';
$use_synonyms = '<useSynonyms>true</useSynonyms>';

# Get keyword variations.
$request_xml =
  '<getKeywordVariations>' .
  '<seedKeywords>' . $seed_keyword . '</seedKeywords>' .
  $use_synonyms .
  '<languages>pt</languages>' .
  '<countries>PT</countries>' .
  '</getKeywordVariations>';
===========================
In line of code you can see above, I tell to the API, I want relation keywords of word "europe", from Portuguese language and from Portugal country.
I want extend the result for two country's at the same time. I don't know if adwords api accept this.

So, if I want extend the country to Portugal and Brazil at the same time what I put between <countries>....</countries>.
I try to put PT-BR and PT, BR, and the system return this error: This country code is not valid.  PT-BR.
Maybe what I want is not possible, but I have to make sure.

Regards, JC
Web Development SoftwarePHP

Avatar of undefined
Last Comment
Pedro Chagas
ASKER CERTIFIED SOLUTION
Avatar of HyperDawn
HyperDawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Pedro Chagas
Pedro Chagas
Flag of Portugal image

ASKER

For the code work you have to erase one of this line:
  'br' .  //BR is Brazil, and Brazil language is Portuguese, so for both is "PT".
PHP
PHP

PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.

125K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo