When the Google Maps API Key will be restricted by domains, it can't be used anymore for Geocoding API, because Geocoding API can be only restricted by ip addresses. Also the Geocoding API Key is used server-side, so there is no Domain used as referrer. If you switch the whole API Key to ip address restriction, the maps on frontend won't be loaded anymore because of ip address of client will be used.
Best practice is using a second API Key just got Geocoding API. The first one won't be changed and can be used for JavaScript API.
When the Google Maps API Key will be restricted by domains, it can't be used anymore for Geocoding API, because Geocoding API can be only restricted by ip addresses. Also the Geocoding API Key is used server-side, so there is no Domain used as referrer. If you switch the whole API Key to ip address restriction, the maps on frontend won't be loaded anymore because of ip address of client will be used.
Best practice is using a second API Key just got Geocoding API. The first one won't be changed and can be used for JavaScript API.
https://developers.google.com/maps/faq#browser-keys-blocked-error
For this case I have added a second API Key field in settings, which will be used for geocoding.