Whether you are a business student, a major in marketing, looking forward to building your own company or a simple marketing aficionado this website is made for you :)

This website will help you understand how can marketers use databases in order to better target their audience.


Imagine you work at the marketing department of Nike. After noticing a decrease on sales over the past semester, your boss has asked you to launch a new marketing campaign in order to increase the sales. One part of the team will be working on the publicity and communication of the brand while you will be in charge of trying to bring back previous customers who have already purchased Nike products in the past.

To do this, you will need to refer to your company's database, that way you will have in your posession the names and the emails of the previous buyers. Your ultimate goal is to send specific emails to a specific category of your database. For example, you will be sending an email containing the company's new line of shoes for women almost exclusively to the female category of your database. In coding terms, the process of selecting a part of your database is called "query" and in marketing it is called "targeting"

Marketing is a systemic process that requires to go over several steps in order to be able to successfully launch a new product or win the loyalty of your clients. Marketing as a whole consists of several steps:
  1. Understanding the client.
  2. Running a competitive analysis.
  3. Analyzing the consumers and their behaviors.
  4. Defining a strategy.
  5. Building a marketing mix.
  6. Analyzing the results.
  7. Revising the strategy.
As you can see, marketing relies uppon very specific steps that have to be followed carefully in order to ensure the success of your product and the loyalty of your customers.

The point of this website is not to display the theory of marketing as a whole but rather to adress one specific subject of it, the thrid step shown above: the analysis of the consumers and their behaviors.

Indeed, in marketing, consumer analysis is called "targeting" the audience. Market targeting relies uppon the evaluation of the market segments based on the overall atractiveness of the segment (segment size, potential growth, profitability...) and on the company's objectives.

A company, whatever its sector, has a large variety of customers. In order to be efficient, the company should be able to know its cleints and classify them according to several categories: gender, age, social and economic background, shopping behavior, personal situation... By classifying its clients and potential clients into categories, companies are able to better target their audience and launch their product successfully.

But what relationship is there between targeting in marketing and databases?

Glad you asked ;)

First of all, we need to define what a database is: a database refers to a set of related data and the way it is organized (definition excerpted from Brightspace, Designing With Web course ). In other words, a database is a file that contains any kinds of information you can collect from a customer: name, last name, gender, age, profession, email, preferences... This information is gold when a company is looking to launch a new product or wants to win the loyalty of its clients.

However, targeting an audience in marketing is a costly process because a given company will want to reach the largest number of customers at the lowest cost possible.

This is where it gets interesting. Databases are very helpful when wanting to target only a specific category of people.

Here is how you can target a specific audience thanks to databases.

The first step is to access the database of your company. Here, we will be using a database from Google's Firebase.

Once you access the database, you should have something like this:

Congratulations, you have accessed information about your database!

Now let's get back to our scenario. Remember: your mission is push previous customers into purchasing a Nike product. For that let's select three different categories of people that we are going to select by querying the databases.

  1. Target women.
  2. Pretend you want to send an email to all of the women from your database to let them know about this amazing new arrival: the Nike Air Max 90 FlyEase.To target only women, you will have to use queries to filter your data and retrieve only the female users. For this, take a look at the Glitch Iframe embeded below. The line that allows us to select a specific category is the line 14 of the script.js file.

    Great! you've learned how to query data from a database throught Glitch. Now let's do the same thing for men using the same principle.

  3. Target men.
  4. Using the same principle, we will be querying the data for men. Pretend you want to send an email to all men from your database to let them know about this amazing new arrival: the Nike Merlin soccer ball.To target only men, take a look at the modifications on line 14 of the Glitch Iframe embeded below: notice that the content of .equalTo has been transformed into "male". That is all you need to query data, pretty cool isn't it?

    Awesome! you have mastered the query of data according to gender specificities. Now, before entering the email sending phase, let's take a look into query according to age.

  5. Target teenagers.
  6. You have probably guessed it by now, queries are a very powerful tool. And you can query pretty much any information! For more complex queries you can refer to the following website Querybase. For this scenario, you want to target only children and teenagers from ages 13 to 18 to drive them towards buying the Jordan Rivals fanny pack.

    Well done, we are finally over with the query of data in a database, but keep in mind that you can query many more things as shown in Querybase.

Alright, so far we have managed to query and therefore select and target a specific audience. Now that we have done that we need to send the emails to our targets. For that we can use Nodemailer, a platform that provides source codes to send emails. If you copy the code shown on Nodemailer, you should be able to get something like this:

Our job here is done! Here's lol cat meme to congratulate you for having gone through everything: you now know how to code databases and how they can be helpful for marketers in targeting their audience.