Configure the Google Address Autocomplete App

The Google address autocomplete app can be installed from the Sana App Center.

Step 1: In Sana Admin click: App Center > Apps > Apps Explorer. When the Google address autocomplete app is installed, you can configure it on the app details page by clicking on the Configure button .

Step 2: Obtain a Google Places API key from the Google Cloud Console. The API key is needed to establish the connection between Sana Commerce Cloud and Google Places.

For more information on how to create an API key, see Use API Keys with Places API on the official Google Maps Platform documentation.

Step 3: Enter the API key. Click Test API key. Make sure that the API key is valid.

Step 4: Consider the usage of the option Use session tokens.

Autocomplete (New) uses session tokens to group the query and selection phases of a user autocomplete search into a discrete session for billing purposes. For more information, see Session Tokens and Places API Usage and Billing on the official Google Maps Platform documentation.

  • If the Use session tokens setting is disabled, each request Sana Commerce Cloud sends to Google API will be charged. Webstore owners pay for a number of requests their customers make when typing the address.

  • If the Use session tokens setting is enabled, customers must pay for a session. A session starts when a user starts entering a query and ends when the user selects a location and calls Place Details. Each session can have multiple autocomplete queries followed by a single address selection.

Step 5: In Sana Admin click: Setup > Profiles & addresses.

Configure the Text box autocomplete editor. The Text box autocomplete editor can be used for the Address and Zip Code fields on all forms where the address is available, for example, the registration form, shipping address, and customer profile.

If the Google address autocomplete app is not enabled, the Text box autocomplete editor will behave as the Text box editor. The autocomplete functionality will not work and customers will need to enter the address manually.

Also, you can format the text in the Address field. In Sana Admin click: Setup > Page elements & messages. Edit the GogglePlaces__AddressFormat text. You can swap places for the replacement tags [StreetNo] and [Street].