I use my Garmin GPS to measure the miles on each of my 'countryside' walks. I don't count walks into town (Bakewell) to do shopping, apart from if I go 'the long way round'. If I do that, I can walk anything up to 7 miles (on tracks/trails/footpaths) before I even get to the supermarket, so I feel those are worthy of adding to my yearly total.
I recently walked around Berwick for a few hours, including the whole of the wall that surrounds the town.
I also walked by the River Tweed for a while, visited the castle and walked all the way down the pier.
I used my GPS on that day simply out of curiosity, although I did end up adding the mileage to my running total.
I was wearing my walking shoes, after all!
Generally though, if I'm mooching around a town sightseeing/browsing etc, I don't record those miles.