From phone companies to cosmetics brands to coffee shops, the business world is swimming with loyalty programs. In fact, more than 90% of companies have some sort of loyalty program in place. Why? Because customers love them, and businesses can profit from them. The average consumer belongs to 14.8 loyalty programs and, done well, these programs can generate as much as 20% of a company’s profits.

It makes sense to reward your loyal customers for sticking with you, but it’s important to take a step back before leaping into a new loyalty program. Not all loyalty programs pay off for businesses — even large companies have fallen into the trap of creating programs that are too good to be true. For instance, Tesla’s original rewards program had to be restructured after 6-months because the company realized that its costs were too high and the program was cutting into their margins. Done right, a loyalty program will more than make up for its costs. You just need to find the right recipe for your business.

So as a small business owner, how do you create a loyalty program with the right incentives for your customers, as well as the right financial structure for your business? Here are 5 tips to create a successful (and profitable!) loyalty program:

Tip #1: Focus on where the pain points are — both for you, and your customers

Every business has gaps in its sales cycle that could be closed. If you’re a hair salon, you face an onslaught of customers on the weekends but empty chairs during the weekdays. For a bed and breakfast, you’re booked during the peak season but want to boost business during the off-season.

At the same time, your customers have their own pain points. They want to have more access to your services when they’re available, and they want financial incentives for sticking with you. The key is to consider both sets of needs and create a loyalty program that is designed to address both sides. For example, if you offer a half-price haircut to loyal customers if they come during weekdays, they are incentivized to visit during their lunch break. They save money without sacrificing convenience, and you encourage people to visit your business when it would otherwise be slow.

Tip #2: Be sure your loyalty program addresses your best customers

For a while, it was very trendy for businesses to offer coupons incentivizing new customers and irregular customers. But as the fate of companies like Groupon has shown, these tactics are sometimes nothing more than a fad, and might not pay off for small businesses. Your best customers are critical, and they have the loyalty that you want to keep. Studies have shown time and time again that loyal customers are better for your bottom line: They purchase more often, spend more per transaction, are more forgiving when things go wrong, and are more likely to recommend your brand to their family and friends.

As stated in a recent Forbes article on the value of investing in customer loyalty, “keeping your current customers happy and making repeat purchases is key to growth for almost every business”. So be sure that your loyalty program is tailored to them as much as possible. One option is to create a separate, exclusive program only for your top customers, giving them greater discounts for spending more, or better perks when they do patronize your business.

Tip #3: Build your loyalty program into the full customer experience

Rather than simply offering a punch card to get free items, consider offering a heightened shopping experience for your most loyal customers. For example, you could give early access codes to shop new launches or create exclusive VIP sales and events. Another option might be providing free expedited shipping for every loyalty program member, along with more flexible return policies. The goal is to make it as easy as possible for your best customers to continue purchasing from you. You might even make the customer service for this group downright luxurious. Knowing how to do that for your customers is key to your success as a small business owner.

Tip #4: Keep track of your most loyal customers, and target the next generation

To maintain a successful loyalty program, you must know who your loyal customers are, as well as who has the potential to become a loyal customer. To gain this knowledge, you need a tracking service. If you don’t already have a data tracking service that offers insight into your customers’ behavior and buying trends, companies like HubSpot or Salesforce, which are designed for businesses of all sizes, offer those services. These tracking services can provide all kinds of benefits for your small business, from customer retention to increased productivity.

Tip #5: Don’t forget personalization, and surprise

Who doesn’t love a pleasant surprise now and then? This same rule applies to your loyal customers. Rather than handing them a punch card for free baked goods, consider offering them benefits throughout the customer journey, as rewards for their loyal patronage. When they place their 100th order, give them a nice discount. On their birthday, offer them a dozen bagels on the house. Delight them with a free-of-charge service; perhaps this occurs on their 10th visit, but they don’t have to know that they’ve “earned” this whimsical treat, and they might even feel more loyal if the gift comes as a complete surprise, rather than as a result of a completed punch card. These loyal customers are providing you with their business for a reason — you’ve gained their trust. A great way to maintain that is to continue to treat them with respect and care.

No matter how you structure a loyalty program, the most important thing to remember is that you have two goals: to make good customers into great ones who never leave you, and to increase revenue for your business. It can be a delicate line to walk between the desires of customers and the needs of a business, but with some ingenuity and research, you can create a loyalty program that keeps your best customers happy while also improving your bottom line.