When tech giant Gryzzl sent hundreds of potential customers personalised gifts with the intention of winning them over in a fight for brand loyalty, the tactic backfired because the company used the consumers’ emails and text messages to figure out what to give them. Although the potential customers loved the gifts, they were shocked by the invasion of their privacy.

Fortunately, Gryzzl is a fictional company that was featured on the NBC sitcom “Parks and Recreation.” But the dangers of data mining highlighted in the Gryzzl story line are real. Data mining could cost you valuable customers or, worse, prompt legal action. For example, in 2014, Facebook users slammed the site with a class-action lawsuit for mining private messages.

Although a personal touch goes a long way in online marketing — even without reading your customers’ personal emails — it’s easy to toe the line between benefiting customers and scaring them away.

Data mining the right way

Data mining does optimise the shopping experience for customers by making it easier for them to find exactly what they want — in an experience tailored to them. Of course, this personalised experience benefits your business just as much as your customer: offering them exactly what they want before they even know they want it means they’ll spend more, and spend more often.

Marketers have access to a wealth of data about customer preferences and behaviour, but that doesn’t mean it’s all fair game. If you’re combing through users’ social media profiles to find out their likes and dislikes, it’s time to reevaluate your strategy.

First, companies should distinguish between implicit and explicit data. Implicit data is any information customers don’t directly give to marketers, such as private messages or even public tweets. Explicit data, on the other hand, is information customers intended to provide, such as answers to surveys or registration forms.

Many customers love when sites save their sizes and preferences, but as the Facebook lawsuit shows, they’re less enthusiastic when brands use information they deem private. Before collecting or using data, ask yourself: Did my customers mean to give me this information? If not, you should not use it.

Most importantly, make sure your customers’ information is secure. It’s no wonder that shoppers are leery of corporations — 12.7 million US consumers experienced identity theft in 2014. So when you ask customers to share their information, maintain their trust by keeping their data safe.

You should also review your data collection processes to determine what pieces of information you regularly collect. Delete any information you don’t need, and use strong password policies or two-factor authentication to protect the rest.

Communicating your security policies also will make customers feel safe. Your privacy policy should tell customers what information you gather, how you use it, and what steps you’re taking to protect it.

Next, create an incentive program. Customers are more likely to volunteer information if they get something in return. In fact, according to Bond’s 2015 Loyalty Report, 75% of respondents said loyalty programs helped them decide on a brand, while 68% said the programs made them more willing to share personal information with brands. Loyalty programs and exclusive deals allow you to gather information while showing customers how much you value them.

Finally, know when enough is enough. A well-placed banner ad that reminds a shopper about an item might just prompt a purchase. But if a few exposures don’t do the trick, it’s unlikely several hundred more will. Overly aggressive marketing only turns off potential customers. In fact, 46% of survey respondents said aggressive advertising makes a brand less attractive, and 82% said they ignore intrusive advertising.

To avoid frustrating consumers, refrain from using persistent emails, ads, and notifications. Limit the number of exposures any individual consumer sees, and don’t use pushy language. You don’t want consumers to associate your brand with irritation.

Personalisation and data mining are great tools for online marketing, provided you use them correctly. The moment you place your marketing goals above your users’ needs, you risk losing their trust and loyalty. Respect data boundaries, and you’ll keep them coming back over and over again.