Campaigns are buying TV ads, web banners, and producing a wealth of videos for social media, and they’re using technology to target voting blocs with ever-increasing precision.