I studied Mandarin at
this school in 2013 in Beijing and Chengde. There is no "best place to learn Mandarin", as it depends on what you are looking for.
Shanghai is international, modern, a lot of foreigners, a lot of people who speak English and you can get pretty much anything you would be able to in a western city as well. At the same time it is expensive and the local accent spoken there is not that good. That would be one extreme for international/big/modern city.
The other extreme would be a smaller city in Northern China ("smaller" means just a few million people in China usually). There they speak good Mandarin and usually there are almost no foreigners. So that will mean you practice a lot of Chinese, but also a lot of culture shock. You will struggle to get a lot of stuff (bring toiletries etc. with you). I
studied Chinese in Chengde which I quite enjoyed, but I would say you have to be ready for some pretty severe culture shock to enjoy it.
Beijing is kind of in between those two options, with a good local accent spoken, moderate living costs, but also a relatively big foreign expat community and international services and shops available. I went to Beijing first to settle in and then to Chengde, which I think is a good way of doing it.
I studied with LTL, because they organize these kind of multi city programs. For me it was a good choice and I found them honest and helpful during my stay with them. The teachers I had were good and the whole program quite well organized. In Chengde they only offer homestay accommodation though, so you have to be ready to live with a Chinese family, which was quite an experience for me (I am 55).
Whatever you do, I think learning Mandarin before you do your trip is a smart choice. China is so much more interesting if you can speak at least a little to the people and you for sure get treated better if you make an effort speaking the language.