Not "during JFK times", but in the JFK campaign. Not so much shaping campaigns around beliefs, but assessing who matters to your campaign as a pure technical pursuit.
As for your jab, if you think that the President has somehow foisted his campaign on the electorate, rather than the other way around, that is the sort of profound misapprehension that doomed his opponent.
The fact that voters can be convinced to agree or disagree with the candidate is more or less orthogonal. Do you think that JFK never influenced a voter by speaking?
https://consequenceofsound.net/2019/09/donald-trump-elton-jo...
https://www.vanityfair.com/news/2017/06/donald-trump-roy-coh...
It didn't matter to him that Hillary used to be "bad" then went "good" ("evolved"), while Trump use to be "good" then went "bad" ("devolved"). For him, it was both of their original positions that mattered, not their trajectory or where they ended up, or even the effects of their words and deeds.
He wouldn't give her the room to improve, because improving was only "politics", but he gave him the benefit of the doubt that he didn't really mean the anti-gay things he said and did, or actually agree with the anti-gay people he chose as vice president, supreme court judges, cabinet members, etc, because selling out his actual beliefs to the right wing in exchange for power was only "politics".
People know very their politicians are lying to them and everyone else, but they pick and choose which lies to believe and which not to believe, because they think the politicians are nodding and winking at them personally, because they're in on the game, and it's justifiable to lie for power because the ends justify the means, at least for their team. That's why dog whistles work so well.
Of course it's best if someone believes in doing good and then does it, but ultimately, results you're getting matter more than intentions you're betraying.