Jump to content

Address field and Profile Completion improvements

KT Walrus

Recommended Posts

The current Address custom field prompts the user to approve sharing their current location with IPS4 in order to make Autocomplete work better.

I feel this is a bit annoying and possibly could trigger privacy concerns about my site (possibly tracking the exact movements of my users).

I would like to remove the need for the current location for Address fields. Rather, I would like to see a new MemberLocation field implemented and add this location field to the Basic Info fields of the new Profile Completion feature.

The MemberLocation field would have two inputs:

  1. Country (with default country selected)
  2. Text Input with Google Maps autocomplete for cities or regions

Google Maps autocomplete allows restricting the search to "(cities)" or "(regions)" within a country. The autocomplete returns the lat/long associated with the city, region, or postal code. This location should be stored in the member's record (just like birthdays, profile photos, and other Basic Info fields) and the Address custom field should be updated to use the Member's Location for restricting the Autocomplete searches.

If the site doesn't gather Location information during profile completion, the IPS GeoIP Service could be used to locate (in the general area) the member's location (either the IP used for sign up or posting or just to display the form containing the Address field). This GeoIP is probably good enough for use by Google Autocomplete.

I have a Support Request in already to move the Google Autocomplete server-side (to increase security of my Google API Key) so this would be a good feature to implement if Google Maps calls are done server-side rather than client-side in IPS4.2.

I also feel it would be good for the new Profile Completion feature to support more Basic Info fields right out of the box. So, adding a Member's Location seems like a good basic info field for many sites. I would also like the option of just a Member's Country basic info field.

Finally, it may be the case that you should remove the request for the user's current location altogether if you choose not to add a Member's Location profile field or use the IPS GeoIP Service. I believe that Google Maps already GeoIP's the client-side requests and uses this to show relevant autocomplete addresses by default. This wouldn't work if you moved the Autocomplete server-side (in which case, IPS4 would need to use the IPS GeoIP Service or Member's Location to center the search around the member's location and not the IPS4 server's location).

Link to comment
Share on other sites

BTW, if you do decide to implement a MemberLocation form helper, you should support at least these 4 types of locations:

  1. Country-only locations
  2. Cities-only locations (restricted by Country selected, using "(cities)" on Google autocomplete)
  3. Regions locations (restricted by Country selected, using "(regions)" on Google autocomplete)
  4. Postal Code-only locations (restricted by Country selected, using "(regions)" on Google autocomplete)

I've mostly implemented the above for my site, but my Postal Code-only location is a bit of a hack. Google autocomplete doesn't seem to support "postal_code" on autocomplete so I had to specify "(regions)" for autocomplete and make sure the user selects a place with a postal_code and then overwrite the full location text in the input field with just the postal_code. This isn't as smooth a UX, but it does work.

Since my site only asks for Postal Codes in the US and Canada, I may end up purchasing a database of these postcodes and implementing my own Postcode form helper that doesn't use Google at all. If IPS4 would move the Google Autocomplete server-side instead of client-side, IPS4 could probably implement a better Postcode form helper since the server-side could verify that the user is typing in only postcodes and only return the postcode part of Google's formatted location to update the input field for the user. In fact, I may try this myself by using the Ivory Google Map PHP API to call Autocomplete on the server-side.

Still, I suggest IPS4 implement the 4 Basic Info profile completion fields in 4.2:

  1. Member's Country
  2. Member's City
  3. Member's Region
  4. Member's Postcode

and store those values directly in the members record for easy access.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...