// Get geo location.
GeoLocation[] geoLocationResult = geoLocationService.get(selector);
GeoLocation geoLocation = geoLocationResult[0];
// Create location extension.
LocationExtension locationExtension = new LocationExtension();
locationExtension.setAddress(geoLocation.getAddress());
locationExtension.setGeoPoint(geoLocation.getGeoPoint());
locationExtension.setEncodedLocation(geoLocation.getEncodedLocation());
locationExtension.setSource(LocationExtensionSource.ADWORDS_FRONTEND);
// You can optionally provide these field(s).
locationExtension.setCompanyName("Google");
locationExtension.setPhoneNumber("650-253-0000");
// Create campaign ad extension.
CampaignAdExtension campaignAdExtension = new CampaignAdExtension();
campaignAdExtension.setCampaignId(campaignId);
campaignAdExtension.setAdExtension(locationExtension);