The Best Programming Languages for Digital Marketers

code screenshot

In the world of data-driven marketing, more and more tasks require a bit of coding. You might need to add an extra parameter to your tracking code or pull raw data from Google Analytics. You may want to create a simple prediction—or automate a few repetitive tasks in your PPC campaigns.

Or maybe you simply want to speak a common language with your developers so that you can brief them better and understand they may say, “This will take two weeks.”

Regardless, knowing one or two data languages—even at a beginner level—is a great help for an online professional’s daily job and, consequently, huge advantage over your competition.

Which programming language should marketers learn?

For a newcomer, there are four programming languages worth learning:

  1. SQL*
  2. JavaScript
  3. Python
  4. Bash

*Technically, SQL is a “declarative language,” not a programming language, but it has the “functionality of a mature programming language.”

Of course, you don’t have to learn all four at once. Even learning one will solve many, many problems that you never could’ve imagined solving before. Besides, after learning your first programming language, it’s usually much easier to learn the rest—you’ll already understand the underlying computer logic.

But which language is good for what? Who should choose which one? It depends on several things:

  • the tasks you work on;
  • the tools you work with; and
  • your goal with the given language.

In this article, I’ll answer all these questions and provide an overview of the four most popular languages for digital analytics professionals.

But first… Why do we have more than one programming language?

First, there are historical reasons. They’re similar to why we speak different languages in different countries. Python, SQL, JavaScript, and Bash were created by different computer scientists in different circumstances. Eventually, as other people started to use these languages, they found their own way to grow.

The second reason is more important. Python, SQL, JavaScript, and Bash are good at different things. You can solve some tasks in JavaScript that you would never be able to solve in SQL. For example, it’s easy to create predictions in Python but really difficult in Bash.

Every language will have its advantages and disadvantages, so you should choose wisely based on the questions you want them to help answer.

Let’s see the languages one by one!

SQL

Best at: data analysis; quick and simple data queries—even on multi-million-line datasets; joining data tables efficiently

Marketing goals: accessing in-depth user data from your company’s database; running advanced queries on Google Analytics data, etc.

Difficulty: 3/10

Get started with: SQL For Data Analysis Tutorial Series

SQL is a relatively simple language. It stands for “Structured Query Language,” but I like to call it “Excel on steroids”—it highlights its essence. SQL is great for running queries on really big tables (even tables with more than 10 million rows). It can get a massive job done, sometimes in seconds, while Excel often keels over with just a few hundred thousand rows.

Handling million-line datasets efficiently is one of the greatest powers of SQL, and it’s the main reason that many companies store a significant amount of their data in this format. The trade-off is that SQL doesn’t have a user-friendly point-and-click interface; we have to access our data by writing code-based queries.

Here’s the difference between a SUM() function in Excel (top) and SQL (bottom):

excel sum function

sql sum function

For me, SQL is the best “entry language” to the world of coding because it’s simple and straightforward.

How SQL solves real-world marketing problems

Create more accurate, detailed reports

One of my former colleagues, Rob, is an SEM guru—with zero coding background. Years ago, he endured continual data discrepancies among Google Adwords, Google Analytics, and internal company reports—sometimes greater than 10%.

Rob didn’t know which report was the best guide for his next move. (Everyone who works with PPC tools has probably experienced the same problem at least once.) He also didn’t understand how internal reports were built, and the developers—as usual—had a more important project than helping him debug them.

One day, he got so annoyed that he decided to learn SQL by himself. He picked up the knowledge he needed in less than two days. (In my experience, it’s quite feasible for almost anyone to reach an intermediate level in SQL in that amount of time.)

After that, he could easily query the company database and find the bugs. He was also able to build more accurate, more detailed reports since he had the business knowledge and the coding skills.

Create refined segments with Google Analytics data

Digital analysts should also know that BigQuery, a Google product, lets you use SQL to manage Google Analytics data.

For instance, you can join different Google Analytics tables to create reports that aren’t possible in the Google Analytics point-and-click interface. Other use cases include diverse, data-heavy tasks such as querying the metadata from 1 billion taxi rides or back-end monitoring of analytics for real-time fraud detection.

The standard Google Analytics user interface lets you use primary and secondary dimensions to create micro-segments by, for example, looking at the number of sessions by landing page and source.

But, if you know SQL, you can segment your Google Analytics data further by adding a third and fourth dimension (e.g. location and device type). Plus, you can add advanced filters (like counting only the top 20% most-active users) and run advanced calculations (like using the median instead of mean), and many, many more things.

JavaScript

Best at: implementing tracking codes; every kind of web-development solution

Marketing goals: improving accuracy or granularity of tracking for better data quality

Difficulty: 8/10

Get started with: Codecademy’s JavaScript course

JavaScript is one of the most frequently used programming languages in web development (besides HTML and CSS). If something pops up, animates, auto-scrolls, sparkles, or changes, it’s probably written in JavaScript.

But, for digital marketers and CRO professionals, it’s even more important to know that almost all tracking codes are written in JavaScript.

Here’s one you’ve almost certainly seen before:

gtm container code
The Google Tag Manager container—and most tracking snippets—use JavaScript.

That code snippet—used to implement Google Tag Manager—is in JavaScript. So are the code snippets for Google Analytics, Hotjar, Crazy Egg, Facebook, Reddit, Google Ads, DoubleClick, and many other tools. To insert these tracking codes onto your website, you don’t need to know much about JavaScript; most tools have simplified the process to a copy-and-paste action.

However, to set up advanced tracking—like scroll-depth or cross-domain tracking—a basic knowledge of JavaScript can ensure proper implementation. With more advanced applications of JavaScript, you can automate repetitive tasks in Google Ads, pass UTM parameters between different websites, and take advantage of countless other opportunities.

JavaScript is definitely more difficult than SQL. It can take a few weeks of 1–2 hours of daily learning to build a solid foundation. But that’s more than enough to understand and modify your tracking scripts, simplify automation, and, most importantly, improve communication with developers.

How JavaScript solves real-world marketing problems

Connect inventory with ad campaigns

One of my clients had an ecommerce company with more than 100,000 products. They constantly added new products, discontinued old products, ran out of stock, or filled up their storage house with best sellers.

The business was so complex that their ads couldn’t keep up— they should’ve started and stopped Google Ads campaigns every minute, but it was impossible to do that manually.

So, one of their marketing interns(!) started to learn JavaScript with the kind help of a mentor from the web team. With about one month of learning and practice, he was able to set up a JavaScript automation that passed information between the company database and Google Ads.

After that, the campaigns started and stopped automatically based on the company’s inventory data. It saved their team countless hours of work, reduced human errors, and saved ad spend—they no longer wasted money promoting out-of-stock or discontinued products.

Enable robust A/B testing

JavaScript has a critical role in conversion optimization, too. jQuery, a JavaScript library, powers the HTML/CSS changes for A/B testing.

Marketers without jQuery skills rely on testing tools’ visual editors to design and publish A/B tests, often with bad results.

Either the lack of coding skills limits their ability to test what matters or over-ambitious changes break the site.

Python

Best at: predictive analytics; machine learning; APIs

Marketing goals: running advanced analytical methods on datasets; making predictions to guide future planning

Difficulty: 7/10

Get started with: Python for Data Science Tutorial Series

Python is a favorite language of data scientists. In many aspects, it’s similar to JavaScript. (The two languages have about the same level of complexity.) Even the syntax looks similar. For example, compare the “if” function in JavaScript (left) with the one in Python (right):

python vs javascript syntax comparison

The big difference, though, is that Python is primarily for “back-end” and analytics tasks, not “front-end” tasks (e.g. website development).

From an analytics professional’s point of view, the greatest advantage of Python is the many analytics extensions written specifically for data-science tasks. If you want to run predictive analytics or a machine learning project, you will probably work in Python.

Additionally, many popular digital analytics and marketing tools offer access to APIs. (A quick, non-technical explanation of APIs is available here.)

How Python solves real-world marketing problems

A few recent projects come to mind:

  • At many startups, we used Python to predict whether users would cancel their subscription in the near future—then reached out to them proactively.
  • At a larger company, we used Python to estimate the expected increase in support tickets and planned our quarterly hiring on those numbers.
  • At a very small company, we used Python to scrape huge walls of text automatically and analyze media mentions.
predictive analysis python
You can run advanced analytical projects, like this predictive analysis, in Python.

There’s another example, too, albeit one that’s a bit out there. In early 2018, I wrote code in Python to connect to a cryptocurrency service provider’s database using their API solution.

Still in Python, I queried the exchange rate of Bitcoin every minute, and, still in Python, I tried to fit a statistical model to predict the exchange rate change for the next 10 minutes. (Before you get excited: I tested over 10,000 models, and none gave an accurate-enough prediction.)

But you can run similar projects using your Google Analytics data, Google Ads data, or any internal company data—if you know Python. I’d recommend starting with a few weeks (1–2 hours per day) to learn and practice the syntax, and to get familiar with its marketing-oriented extensions.

It’s a realistic goal to run your first (simpler) predictive analytics project in Python at the end of a month. Of course, don’t expect to become a senior Python developer from one week to another, but at least you’ll be able to communicate with developers much efficiently. Additionally, if you’ve already learned JavaScript, learning Python will be easy. (It works the other way around, too.)

Note: You may have heard about another popular language similar to Python called R. It’s used mainly by mathematicians and statisticians, and its syntax is a bit more difficult to learn compared to Python. Because of that and other reasons, I recommend Python over R for digital analysts and CRO professionals. However, some “hardcore” statistical packages are available only in R.

Bash

Best at: moving files, automating scripts, connecting other languages

Marketing goals: automate reporting

Difficulty: 5/10

Get started with: Data Science at the Command Line

Bash is a “bonus” language—and it’s not really famous, either. But you should know that it’s the built-in language of every computer that runs on an Ubuntu/Linux operating system and, thus, the language of most data servers, too.

Bash is not the first language you should learn, but it’s not difficult. The basic view is the classic “command line” design. Many programmers like it: It looks cool (a question of taste, of course), and it offers clear access to communicate with the computer on a core level.

bash command line
Bash offers clear, deep access to data servers’ operating systems.

How Bash solves real-world marketing problems

I use Bash for three specific tasks (mostly in data-science projects):

  1. Moving, copying, cleaning, and re-structuring data files on a remote data server.
  2. Automating scripts (e.g. pulling user data, formatting it, and saving it to a server automatically at midnight).
  3. Connecting Python and SQL scripts and running them together.

For instance, in the early days of Prezi (my first workplace), we built the entire data infrastructure using only Bash, and it handled the data of 3 million users—for the above tasks and reporting—very well.

You can learn the basics of Bash in one or two days. However, it makes sense only if you’ve already learned SQL or Python (or both).

What’s the best way to learn a programming language?

To learn these languages, there are plenty of free and paid resources, online and offline. (I’ve linked a resource at the top of the section for each language.) Whether you prefer books or workshops or even interactive courses, any will guide you effectively through the theoretical basics.

But the most important part of the learning process is practice. Find a small project to apply your freshly gained coding skills to demonstrate the real-world problems you can solve and boost your motivation. Practice will also deepen your knowledge.

Here are a few pet-project ideas:

  • Python: Build a bot that can play Blackjack.
  • SQL + Bash: Scrape articles on news portals and try to collect similar articles from different portals.
  • JavaScript: Try to implement click tracking on your website (or on a test website).

These are just my ideas. By all means: Find something that interests you and that you would enjoy building—then build it!

Even if you don’t plan to become a practitioner, programming knowledge may be essential to help find the right candidate for your marketing department.

How can you find and hire professionals with these skills?

It’s a tough question.

A digital marketer or CRO professional who has a business mindset and also knows how to code is rare. Why? Because they’re two different skill sets. More and more companies, however, have realized the importance of coding in digital analytics, and the demand for these talents is higher than ever.

The easiest way to get the right person on board is to find someone internally—either a programmer who’s interested in business and marketing or a digital marketer who’s open to learning how to code. With the right training programs, it’s not too hard to transition a motivated talent’s career path.

How to interview candidates for programming positions in marketing departments

If you find a good candidate from outside your company (it’s not impossible), make sure that the interview committee has at least one technical person and one business person. It’s not uncommon for these applicants to go through 6–8 well-designed interview rounds, including a take-home assignment and whiteboard technical screenings.

When you look to hire someone, your main goal should be to understand if she can apply her knowledge in practice. Asking theoretical questions like, “Please explain the role of indentation in Python,” or, “How would you calculate standard deviation?” won’t help.

As an applicant, this was a “tell” that the committee had no idea why they wanted to hire me. (And, as a result, I turned down their offer at the end of the process.) The best questions are 100% practical and make the applicant think! For example, “You have these two data tables with X and Y user information. Who are our power users? Why? Write a query for it!”

Conclusion

There’s nothing magical about SQL, JavaScript, Python, or Bash. Anyone can learn the basics of these languages, whether your goal is to become an entry-level practitioner, improve communication with your development team, or make it easier for you to hire the right people.

To get started, pick the one that has the best potential to answer your most important marketing questions, then start learning! After the first few hours, you’ll see that it’s not as complicated as you may think—and how useful it can be in your everyday job as a marketer.

Related Posts

Join 95,000+ analysts, optimizers, digital marketers, and UX practitioners on our list

Emails once or twice a week on growth and optimization.

  • This field is for validation purposes and should be left unchanged.

Join the Conversation Add Your Comment

  1. Epic post, gave me a huge boost to try one of these prog languages. Will check out your other works and courses, as well. Looking forward your next post on CXL.

    Reply
  2. Great article, I can relate to it on so many levels! I’ve experienced so many marketers who are scared of coding, however it makes my days so much more efficient to be able to implement any type of change I want. Especially with GTM, literally anything is possible when it comes to optimization and tracking, thus this skill set is a must :) I hope to see more articles about the digital gap that’s happening right now and I hope more companies will try to bridge that gap – great example is Growth Tribe!

    Reply
    1. hey Matic,

      true, I remember when I first started to use JS + GTM — I had the very same “anything is possible” feeling! : )
      And I don’t have an IT college degree or anything similar either. Still, I was able to pick up coding skills really fast. I strongly believe anyone who wants can do the same!

      ps. yeah, and I know Growth Tribe, they are great indeed!

  3. Thanks for this amazing breakdown Tomi. Python is on my *must learn* list for the rest of 2018. Data36 has just gained one new e-mail subscriber. Off to read some of your other posts.

    Reply
    1. hey Jason,

      thanks – yes, Python is a great choice, actually my favorite (and most frequently used) language out of the four!
      Enjoy the tutorials — and if you are interested in any topic regarding DS that you can’t find on the blog, just let me know — I always priortize my new articles based on readers’ feedback!

      Cheers!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Current article:

The Best Programming Languages for Digital Marketers