$geoLocationService = $user->GetService('GeoLocationService', ADWORDS_VERSION);
$address = new Address();
$address->countryCode = 2826; //UK Country Code
$selector = new GeoLocationSelector();
$selector->addresses = array($address);
$result = $geoLocationService->get($selector);
$geoLocation = $result[0];
if ($geoLocation->GeoLocationType != 'InvalidGeoLocation') {
$lat = $geoLocation->geoPoint->latitudeInMicroDegrees / AdWordsConstants::MICRO_DEGREES_PER_DEGREE;
$long = $geoLocation->geoPoint->longitudeInMicroDegrees / AdWordsConstants::MICRO_DEGREES_PER_DEGREE;
}
Hi Anthony,
I have a problem the same Paul.
Previous, I using CampaignCriterionService for get locations of a campaign existing. But in case, I need search Radius Targeting with paramater is Address. But, in CampaignCriterionService Address File is not filterable.
How to search Radius targeting when input address to text search.
Thanks
$campaignCriterionService = $user->GetService('CampaignCriterionService', ADWORDS_VERSION);
//Set the address
$address = new Address();
$address->countryCode = 2826; //UK Country Code
$prox = new Proximity();
$prox->address = $address;
$prox->radiusDistanceUnits = "KILOMETERS";
$prox->radiusInUnits = 0;