dongzantai7570 2019-08-01 22:50
浏览 109

根据位置选择着陆页重定向(Cookies?)[关闭]

Before someone gets upset that I haven't included code, please understand that it is because I am not sure what the best practice would be.

I have a site that operates in 3 cities specifically, and also a nation-wide version. This is an eCommerce site that has different subdomains (essentially 3 different sites, but the ability to manage products specifically based on location.)

What I need is for the user to select their city or location preference (say New York, Chicago, Detroit or Entire US) and have that information stored so that the next time they return they don't have to reselect their preferred location.

Of course, for UX purposes the ability to change location is available in a Top Nav menu bar should they temporarily be in the other city.

Can IPs be targeted accurately to exact city? Should this be automated or should they be able to choose?

My question is : What is the best practice for this? Are there any consequences to this setup? What should be used? JavaScript? JQuery? PHP?

If there are no major negatives, where should I start to implement this?

  • 写回答

1条回答 默认 最新

  • dousi2013 2019-08-01 23:11
    关注

    IP's technically COULD be used to track general location but are not always reliable and would require a third party service to resolve. This would create overhead and could introduce other problems. In my opinion a better option would be to ask the users location at register and allow them to change it from the UI like you said. You could use only non expiring cookies, but when a user clears cache they will need to reset. I recommend saving this location feature to the users table in DB... and also in the users session at login. This makes for a better, more reliable, and smoother UX.

    评论

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?