Google address autocomplete
On this page
What you need
- A Google Maps API Key
- The ISO code for each country you want to support using this method
Add store variables
- Open your store in StoreConnect.
- In the Store Variables section, click New and add the following variables:
- Name - Address Auto-complete Google API
Key -
google_autocomplete_api_keyValue - your Google Maps API key Available in Liquid -true - Name - Address Auto-complete Countries
Key -
autocomplete_countriesValue - 2-character, comma-separated ISO code for each country you want to support, for exampleUS, CA(Google supports up to five at a time) Available in Liquid -true - Name - Default Auto-complete Country
Key -
default_autocomplete_countryValue - 2-character ISO code for one country you want to include Available in Liquid -true
- Name - Address Auto-complete Google API
Key -
- Click Save.
Update your theme layout template (in Liquid)
- Open your theme record in StoreConnect.
- Open the applicable Theme Template.
- If your theme doesn’t already have a theme template, grab it here and create one for your theme: theme.liquid
- Add the following code to the very bottom of the theme template Content section. This ensures address fields have loaded before the layout runs.
- Select Save.
```liquid
```
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.