How do agile workers work with users / customers?

Reading this posting, I understood that agile is neither top-down nor bottom-up: It is outside-in. The focus is on delivering value to customers. The customer is the boss, not the manager. And reading this article, I learned that instead of asking “How can I get customers to take what we make?”, we have to ask, “What are the unmet needs of the customer that I can find ways to satisfy?”

At atlassian.com, I learned that to find out what users need, it can be helpful to write a user story, for example using this sentence structure: “As a user, I need [goal], so that I [receive benefits].” Inspired by this and this, I discovered some examples of ways to find information to write the user story: 
# 1: Experiment when developing product / service. 
# 2: Use analytics to find out what users do / don’t do with the product / service.
# 3: Ask users what they need / want. 
# 4: Watch / observe users as they use the product / service.

Some additional research and questions about customer needs:

A key feature of being agile is to involve the user in the development process and use feedback from users / customers to improve, for example, the product / service and/or improve how things are done. I learned that by reading this, this, and this. And I understood that by using blogs and other social media, customers can be involved well in the development process.