How Does a Company Find the Best Market to Target Their Ads?

Identifying the best markets to advertise in using Plotly and Tableau.

Yeside Okelana
Towards Data Science

--

Photo by MayoFi on Unsplash

A fictitious e-learning company, currently based in the U.S., has asked me to run a survey to determine the best markets to promote their product. They will also like to know the kind of content that learners are willing to pay for.

This company offers different courses on programming including web development, mobile development, data science, and game development. Web development and mobile development take the largest share of courses offered and learners are billed a monthly subscription of $59 to access the course content and resources.

In this post, I will be walking you through the steps I took to find the best markets for the company; using Plotly and Tableau.

Gathering the Data

I had two options of finding the right data to use — conduct a survey for different markets or use available data from reliable sources. Considering the time and resource constraints that I had with conducting surveys, I opted to use the freeCodeCamp 2017 New Coder Survey instead.

freeCodeCamp is a completely free e-learning site that offers a variety of courses on web development. I chose their data because they run a popular Medium publication that currently has 600,000+ followers. More so, the 2017 survey attracted new coders with different interests.

You can download the data set here.

Initial Data Exploration

I used the following code to explore the data set:

import pandas as pd
survey_data = pd.read_csv(‘2017-fCC-New-Coders-Survey-Data.csv’, low_memory = 0)#low_memory prevents dtype warning
survey_data.shape

Here’s a screenshot of the Pandas data frame:

First 5 Rows of the Data Set in Pandas Data Frame (Screenshot from Jupyter Notebook written by Yeside Okelana)

The data set has 18,175 rows and 136 columns. The column names are also self-explanatory; which made analysis straightforward.

Since I was going to analyze the data set in Tableau, I exported Pandas data frames from my Jupyter Notebook into .csv files with the following code:

df.to_csv(r'Path where I wanted to store the exported CSV file\New File Name')

Distribution of New Coders’ Interests

Recall that even though most of the courses that the company offers are on mobile and web development, they also offer courses in domains like data science and game development.

But first, we need to know how representative this dataset is — do web and mobile development also make up the majority of the new coders’ interests?

To answer this question, I created a frequency table for the JobRoleInterest column in the dataset and made the following observations:

  • A significant number of the new coders are solely interested in web development (Full-Stack, Front-End, or Back-End development).
  • Some people are interested in mobile development.
  • A few are interested in subjects other than mobile and web development.
Screenshot of Coders’ Interests (Image obtained from Jupyter Notebook by Yeside Okelana)

You can check the Jupyter notebook to view the frequency table.

Meanwhile, the frequency table also showed that quite a number of people have multiple job interests. So, it was useful to find out the proportion of coders who had interests in just one subject as well as those who had interests in multiple subjects.

To do this, I:

  • Split the JobRoleInterest column to find out the options each participant selected (I dropped the null values first), and
  • Generated a frequency table for the variable with the options.

Here’s the Python script I wrote to get this done:

Python script for creating the frequency table for Coders’ interests (Written by Yeside Okelana)

I, then, created this bar chart in Tableau to visualize the proportion.

Percentage of Coders by Number of Interests (Bar chart created in Tableau and extracted by Yeside Okelana)

Apparently, about 32% of the coders are sure about the specific programming niche they would like to work in.

However, should the company consider expanding their course curriculum; the fact that 68% of the coders have more than one interest will help them determine the kind of content to introduce.

But since our focus is on web and mobile development, let’s find out how many of the coders are interested in at least one of these two subjects.

I created a pie chart with Plotly to visualize how web and mobile development interests compare to other interests

Coders’ Interests in Web or Mobile Development vs. Other Subjects (Pie chart created by Yeside Okelana using Plotly for Python)

The chart shows that the majority (about 86%) of the coders are interested in web or mobile development. This is an indication that the distribution of the new coders’ interests matches the company’s course distribution.

The next step is to identify the best markets to spend the advertising budget in.

To do that, I found out:

  • The location of these new coders,
  • Locations with the highest number of coders, and
  • How much new coders in those locations are willing to pay to learn.

Location and Density of New Coders

We have the privilege of country-level data in this data set in two columns:

  • CountryCitizen which describes the coder’s country of origin and
  • CountryLive which describes the coder’s country of residence.

However, for the purpose of this analysis, I worked with the CountryLive column since the marketing team is interested in running ads in locations where people currently live.

Also, since the data provides information on a country-level, I treated each country as a market.

In this analysis, I defined markets of interest by the number of coders in that market. In essence, the higher the number of potential customers in a market, the better.

Let’s take a look at the market size…

Overall Market Size (Chart generated from Tableau dashboard by Yeside Okelana)

From this chart, 45.7% of coders live in the U.S. This is a relatively large proportion of the data. Since freeCodeCamp is based in the U.S., it is expected that a significant proportion of the respondents will be from the U.S.

We also see that countries like India with 7.7%, the UK with 4.6%, and Canada with 3.8% make up the top 4 potential markets.

While it is tempting to run off with this information and push marketing campaigns in the U.S markets, for the sake of profitability, it is also important to find out how much coders in these markets are willing to spend on learning.

Revenue Potential

I worked with theMoneyForLearning column to get a sense of the company’s revenue potential in these markets. This column describes how much participants are willing to spend for learning in dollars.

Recall that the subscription rate is $59 per month.

Meanwhile, I restricted the rest of the analysis to just 4 markets — the US, India, United Kingdom, and Canada for the following reasons:

  • These markets have the highest absolute frequencies.
  • Since the courses are written in English, it helps that the official language in these countries is also English. So, there are higher chances of reaching the right audience with the ads.

Next, I created a new column namedmoney_per_month , which describes how much a learner has spent for learning per month. I created this column by dividing the MoneyForLearning column by the MonthsProgramming column. I, then, visualized the values for each of the markets in a bar chart as seen below:

Average Money per Month for Top 4 Markets (Plot is created in Tableau)

From the bar chart, we can see that, on average, learners in the U.S are willing to pay the highest monthly fee.

However, if we consider a few socioeconomic factors like GDP per capita, then one may wonder how it is that learners in India are willing to pay way more than learners in the UK and even Canada.

It could be that the data for Canada and UK are not representative enough or that there are outliers in the Indian data that make the mean too high or there are outliers in the UK data that make the mean too low. It could also be that the data is correct.

Let’s investigate a little further to get closure.

Dealing with Extreme Outliers

I took advantage of the money_per_month column to visualize possible outliers.

The box plot below shows the money_per_month values for each of the 4 markets.

Distribution of Money Per Month in each of the Top 4 Markets (Chart is created in Tableau by Yeside Okelana)

At a glance, we can’t determine from this boxplot if there are extreme outliers for India, Canada, and the UK. But there are obvious extreme outliers for the US — 2 people indicated that they paid over $50,000 a month which is rather strange but not impossible.

However, for the purpose of this analysis, I eliminated values that are greater than $20,000.

The mean values changed after eliminating money_per_monthvalues that were greater than 20,000. Take a look at the new values:

Screenshot from Bar Chart Created by Yeside Okelana

Below is a box plot showing the distribution of the remaining values:

Image from Box Plot Created by Yeside Okelana in Tableau

Looking at the box plot, it is obvious that there are still a few extreme outliers. India has values that are greater than $2,500, the US has values that are greater than $6,000 and Canada has one value greater than $5,000.

I analyzed the values a little further and eliminated a few more outliers based on certain criteria.

For instance, I observed that of the 6 respondents in India who indicated that they spent more than $2,500 for learning, none attended a Bootcamp.

I determined that one probable reason that the respondents inputted such high prices was that they misunderstood the question which is “Aside from university tuition, about how much money have you spent on learning to code so far (in US dollars)?” So, they must have inputted the value of their tuition fee instead. I eliminated such rows.

You can get the full detail of the elimination criteria I used in the Jupyter Notebook.

Here’s a bar chart representing the recomputed mean values for the money spent per month.

Average Money per Month in Top 4 Markets (Screenshot is extracted from Tableau Chart created by Yeside Okelana)

… and a final box plot for the distribution of the money_per_monthin each market.

Distribution of money per month values for Top 4 Markets (Box plot is created in Tableau by Yeside Okelana)

We are now very close to identifying the best markets to advertise in.

Choosing the Best Markets

Clearly, of the 4 markets, the US is one market we should definitely advertise in because the majority of new coders currently live there and they are willing to pay a good price to learn (an average of $143).

Canada seems to be the second market to consider because learners are willing to pay more than what is obtainable in India and the UK.

However, there are a few reasons why it may be better to consider India as a second-best market instead. Here they are:

  • A monthly subscription of $59 doesn’t seem like an expensive price for potential customers in India considering that, on average, they can pay $66.
  • India has almost twice as many potential customers as Canada does.
Size of each market in Top 4 Markets (Created by Yeside Okelana with Tableau)

It is not clear which of the two markets we should choose between India and Canada. So, we are left with three options.

Option 1

Spend all the advertising budget on the US market.

Option 2

Using the ratio of their market sizes, split the advertising budget between the US and India or the US and Canada as follows:

  • 86% for the US and 14% for India.
  • 92% for the US and 8% for Canada.

Option 3

Using the ratio of their market sizes, split the advertising budget between the US, India, and Canada as follows:

  • 80% for the US, 13% for India, and 7% for Canada

These options are, however, best scrutinized by the marketing team who will then use their domain knowledge to possibly run a new survey in India and Canada. With a new survey, I can then run another analysis on the new data for a more informed decision.

Meanwhile, based on the available data, there is no consideration for the UK market because the average money_per_month is lower than the subscription fee.

Conclusion

The goal of this project was to find the best markets to advertise in. From my analysis of the freeCodeCamp 2017 New Coder Survey, it is clear that the US is a good market to advertise in. But making a decision between India and Canada is not as straightforward.

However, I am of the opinion that the marketing team will be in the best position to either use the results of this analysis to determine the other market(s) to consider or create a new survey altogether in order to make a more informed decision.

--

--