Question: I am building a social media platform. I am considering implementing a function to let users view recent visitors to their profile page.

Is it a good idea to let a user view who's visited or viewed their profile? Why or why not?

Answer: 
I think that a good way to handle this would be to let them see *how many* people visited their profile, but then have a setting where people can choose if they want their profile to appear on a list of people who visited somebody's profile, that way people can have a say on who sees their username, while still allowing users to collect information from people willing to have that setting active. Heres an example:

User 1 visits User 2's profile, and has the list setting on.
User 2 at some point receives or looks at a list of people who visited their profile, and sees User 1 on it.

Or

User 1 visits User 2's profile, but has the list setting off.
User 2 receives or looks at a list of people who visited their profile, and does not see User 1 on it, but sees people who had the setting on. However User 1 still counts towards the number of people who visited their account.
Letting users know how many views, in total, their profile has gotten could be beneficial. Stack Exchange used to have this feature prior to some profile redesigns, even though it is not a social media site. It let others, and the user themselves, know how "popular" their profile page is. Or, perhaps more accurately, how often users are interested enough in their contributions that they want to see more.

Here's a screenshot of how it looked:

[![Image of the profile page with the "profile views" counter circled](https://i.stack.imgur.com/XEaCp.png)](https://i.stack.imgur.com/XEaCp.png)

It was a very simple counter that gives you, at a quick glance, a number of views your profile has gotten.

Letting users know who, specifically, viewed their profile would raise more questions than it answers, in my opinion. "Why did (x) view my profile?" would be a constant question being asked in this situation.

If you have an existing community you can poll for such a change, you should do so. Perhaps the people who actually use your social media platform could weigh in on whether they would like such a feature or not, and you can consider their feedback when developing further.