Private companies including social media sites and cellular phone service providers are collecting vast troves of detailed, real-time location and communication metadata and selling without their users knowledge.