{"section":"tutorials","requestedLocale":"en","requestedSlug":"geolocation-at-checkout","locale":"en","slug":"geolocation-at-checkout","path":"docs/en/tutorials/checkout/checkout-settings/geolocation-at-checkout.md","branch":"main","content":"The purpose of this tutorial is to show you the steps needed to use geolocation at your store checkout. \n\nThis function permits deliveries to use a geographical point as a basis (latitude and longitude) instead of a postal code.\n\n### How does this improve my store?\n\nThe geolocation function lets your customers manage their own searches for the required delivery address.\n\nIn other words, on checkout they can use a tool with the ability to find addresses on Google Maps with an icon marking the position.\n\nThis gives the user visual confirmation that the order will be delivered at the required address. The location information will be completed automatically as soon as the point is loaded on the map.\n\nThis function is especially useful in regions where the postal code system is not very accurate.\n\n### Setting up the logistics\n\nTo use this function, proceed as follows:\n\nFirst of all, you must get a Javascript API Key for Google Maps, to permit integration with the Google geolocation service. You can read more about how to do this at:\n\n[https://developers.google.com/maps/documentation/javascript/get-api-key](https://developers.google.com/maps/documentation/javascript/get-api-key)\n\nOnce you have an API Key, proceed as follows:\n\n1. In the VTEX Admin, go to __Store Settings > Shipping > Geolocation Shipping__, or type __Geolocation Shipping__ in the search bar at the top of the page.\n2. Enter the API Key in the field indicated and click on __Register Key__.\n\n![Geolocalizacao 1 EN](https://cdn.statically.io/gh/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/checkout/checkout-settings/geolocation-at-checkout_1.png)\n\n> ℹ️ In some countries, Google Maps does not provide high quality mapping. Therefore it is possible that some addresses will be written wrongly, or Google may indicate an incorrect address. In these cases, you must correct the address on the map itself.\n\n### Setting up the polygon\n\nFor this function to work correctly, you must register the polygons corresponding to the required delivery areas on the map. Then you must associate them with the transport companies making the deliveries, by including the IDs of these polygons in the freight charges table. To this, see the article [Registering geolocation](/en/docs/tutorials/registering-geolocation/).\n\n### Setting up the Checkout\n\nOnce you've created the polygon and entered your ID in the shipping worksheet, you'll need to enter the Google Key API in the Checkout settings:\n\n1. In the VTEX Admin, go to __Store Settings > Storefront > Checkout__, or type __Checkout__ in the search bar at the top of the page.\n2. Click on the <i class=\"fas fa-cog\" alt=\"engrenagem azul\"></i> icon of the desired website.\n3. In the blue options menu located at the top of the page, click on __Checkout__.\n4. In the __Google Maps API Key__ field insert the API Key given in the logistics step.\n\n![Google map keys](https://cdn.statically.io/gh/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/checkout/checkout-settings/geolocation-at-checkout_2.PNG)\n\nOnce the API Key has been included in the Checkout configuration, the geolocation will be visible in your store checkout.\n\n### How does the freight charges search work?\n\nWith geolocation at checkout, the freight charges calculation will always give priority to this option, using the polygons including the coordinates of the selected destination. \n\nSo, even if your client wants to use the postal code, geolocation will be the parameter used by the system to calculate the freight charges."}