Loading...
Sign in to see the examples with your own API key.

Google Places fallback

G-NAF has every address in Australia but no business names, so someone typing Westfield Bondi Junction finds nothing. Switch on the free Google Places fallback and, only when G-NAF finds nothing, the JavaScript Autocomplete searches Google for businesses and places with your own Google API key, straight from the visitor's browser. Addresses always come from G-NAF; Google is only asked for establishments.

What a Google pick looks like

A picked Google place fills your form the same way a G-NAF address does. The record has the same fields, with cleaning_provenance set to {"Source": "GOOGLE"}, the place's name in address_site_name, and everything only G-NAF knows — address_detail_pid, mb_code, legal_parcel_id, geocode_type, level and lot — empty. Check cleaning_provenance before storing an id to pass to Get later.

input.addEventListener('getaddress-au-autocomplete-address-selected', e => {
    if (e.address.cleaning_provenance.Source === 'GOOGLE') {
        // Not in G-NAF: there is no address_detail_pid to keep.
    }
});

Keeping one page on G-NAF only

Pass google_places_fallback: false to the JavaScript Autocomplete on that page.

getAddressAu.autocomplete('address_line_1', '{your-domain-token}', { google_places_fallback: false });

In the API

The Autocomplete response carries your key as fallback when a domain-token request finds no suggestions.

Top