When a new customer registers at your Magento 2 online shop, he is required to fill in certain fields, such as first name, last name, email. He or she may want to provide some additional information. For that purpose we need to create our own fields which will be used in a registration form. If you have Magento 2 Commerce version, new fields can be created by adding new customer attributes in the backoffice.
Determining a customer’s country is widely used in many online stores. Geolocation (often called GeoIP) is used for implementing various scenarios, such as setting the default language, currency, delivery methods and redirecting a user to another URL created specifically for his country.