But she pretty much ran a campaign according to all the best practices, and lost to a guy who basically did everything wrong (within the scope of the campaign) that you could do wrong. The problem wasn't in the Clinton campaign. The problem was that the electorate didn't want what she was selling, despite a very good sales pitch.
I suspect there's going to be a lot of analysis focusing on exactly what level of positional compromise would have gotten the Democrats enough votes in the Midwest and Appalachian states to win (off the top of my head: an about-face on gun control and some sort of mea culpa on NAFTA might do it), but I don't think the Democrats could have known that in advance. Any more than any of the Republicans who lost to Trump in the primaries could have known how badly they were underestimating the latent anger of voters when they ran their own by-the-book campaigns.