You might be thinking of the debate over whether CBP can search your cloud data (vs. only the data present on your phone) at a border crossing.
This is in the same vein thematically but substantially different both legally and technically. It applies to immigrants whether or not they are crossing borders, and it builds a permanent database of what they've found. Whether this is illegal or not depends on the nature of "what they've found" - it sounds like they're "just" going to be buying up the same data sources advertisers use, which is probably legal. (But terrifying.)