Tutorial on SEO Coding, SEO Programming

We all have made promises to learn to code. Some of you may have kept those promises while others haven’t.

If you have already started learning to code then ‘Cheers!’. I have tips for you that will make you a better coder.

If you have not started coding yet then here is your chance to rise and shine.

Why Do You Need to Learn to Code?

There are four strong reasons for that:

1. You get a better understanding of the technical side of a website which hones your SEO and analytics skills.

2. You can speak to your developer in his language and he can’t take you for a ride with any ease.

3. You can solve many problems and automate tedious tasks

When you learn to code, you are in a position to translate any problem that you need to be solved into a format that a computer application can understand and process.

This problem can be anything from automating/speeding certain parts of your SEO process through APIs to building a custom tool that can do tasks like data scraping or manipulating data into a desired format.

Granted there are plenty of third-party tools out there that can do such tasks for you. But they are pretty standard. They may not always meet your special requirements.

4.  You stand out in your career, among your peers and in your industry

The barrier to entry is {high} for coding. Not everyone has the capacity or the inclination to learn to code. No one can learn coding just by reading one or two articles. So when you learn it, you stand out.

You stand out in your career, among your peers, and in your industry.

Strong coding background quickly becomes your strong USP (unique selling proposition) which sets you apart from the competition as you can do regular SEO and analytics tasks with lightning speed and automate processes that can otherwise take several hundred man-hours.

Coding can also make you very rich if you can come up with a tool like ‘open site explorer‘.

The Foundation Course

Following are some terms which I think will help you if you are brand new to programming:

# Computer program (also known as software, or just a program) is a sequence of instructions written to perform a specific task.

# Source code– It is the human-readable text which is written using the format of a programming language. A source code can be written in one or more programming languages.

Example of a Source code written in’ C’ Programming language:

#include<stdio.h>
void main()
{
int i;
printf(“Please enter an integer number\n”);
scanf(“%d”, &i);
}

Example of a Source code written in ‘Java’ Programming language:

public class HelloWorld {
public static void main(String[] args) {
System.out.println(“Hello World”);
}//End of main
}//End of HelloWorld Class

# Professionals who write or edit source code are known as computer programmers (or coders) and the process of writing or editing source code is known as computer programming (or coding).

# Machine code is the language used by computers internally to execute the source code. Machine code is written using a binary numeral system (0 and 1). Computers can’t understand the source code. So they need to take the help of computer programs called ‘compiler’ and ‘interpreter’ to translate source code into machine code. Here is how a machine code can look like:  00101010 11011010

Do you want expert help in setting up/fixing GA4 and GTM?

If you are not sure whether your GA4 property is setup correctly or you want expert help migrating to GA4 then contact us. We can fix your website tracking issues.

System Programmers vs. Application Programmers

Before I give you more coding tips, let me give you a brief intro to my coding background.

I grew up learning programming languages like C, C++, and VC++.

I hold a bachelors degree in computer science; have 5 years of hands-on experience in C and C++ and 1 year of teaching experience.

I am not a web developer. Not all programmers are web developers. Web developers are application programmers who write code to build web applications that provide services to an internet user like me and you.

I wrote code to work for computer hardware and processes which put me under the category of system programmers.

System programmers are the guys who develop and maintain your operating system, develop windows and Linux applications. They are a rare breed of programmers. You won’t find them in regular offices or companies. They are generally employed by computer manufacturers (like Microsoft, IBM) and systems software houses. They code the operating system you work on and the programming languages you code in.

Without system programmers, there will be no operating system (OS) or programming language. Without OS and programming languages there will no internet, no smartphones & no computers. Sounds terrifying?

Application programmers, on the other hand, develop non-system applications. They write programs to manage a specific task like tracking inventory within an organization, developing games, custom software or building the front end and back end functionality of a website.

Web developers are a subset of application programmers. Programmers are often known by the language in which they have developed expertise. For example, a programmer who codes in Java is known as ‘Java Programmer’, a programmer who codes in ‘VB’ is known as ‘VB programmer.

How Programmers Work

A senior programmer/ system analyst interacts with clients to understand their requirements. He then plans out solutions (which include coming up with flow charts, database design etc), recommends software and systems, writes technical specifications and do all the cost-time analysis.

Junior programmers write programs according to the specifications determined by the senior programmer/system analyst.

The programming language that will be used in the project depends upon the purpose of the program. For example programming language called ‘Fortran’ can be used to build a scientific application or programming language called ‘PHP’ can be used to build web applications.

Programmers often copy paste codes from pre-built modules, libraries or the source code developed by them (in the past ) or by other programmers to partially or fully solve their problems. There is, in fact, a term for such type of practice known as the ‘copy and paste programming‘. Copy and pasting is also done by novice programmers as writing code from scratch is difficult for them.

The programmers, SEO usually deals with are known as Web Developers. Web developers do not have truly deep specialization in any one programming language. They are more a generalist. They possess knowledge of various languages used in web programming:

seo coding, seo programming

Scripting Languages

A scripting Language also is known as script or extension language is a programming language that is usually interpreted (i.e. carried out by another program) then compiled (i.e. carried out by computer processor).

The computer processor also known as central processing unit (CPU), processor or microprocessor is the brain of your computer.

It is the hardware device that executes most of the commands from computer hardware and software.

Without CPU, your computer is merely a piece of metal junk. Scripts (like Javascript, PHP etc) are slower than compiled programs as in script each instruction is being executed by an external program which results in additional instructions being processed.

Whereas in case of compiled programs (like C or C++) the instructions are executed directly by your processor.

Scripting languages are easier to code in than compiled languages.

Scripts are often embedded within a text file (saved as HTML, .php etc). Such scripts are known as inline scripts.

They may also be contained in an external file which is then called from within a document. Such scripts are called external scripts.

Technical SEO Article:

Website Speed Optimization – Complete Guide

Types of Scripting Languages

 

Client Side Scripting Language

Server Side Scripting Languages

1In case of client side scripting, scripts are executed by a user’s web browser rather than by a web server.In case of server side scripting, scripts are executed by a web server rather than by a user’s web browser.
2Programs run on client’s machine (Note: your website user is your client). Which means your user might experience error if his browser doesn’t support your script or execute it differently.Programs run on a web server. Which means the script performance does not depend upon a client’s machine.
3A website can use one or more client side scripting. For e.g. a website can use both JavaScript and Flash.A website generally uses one server side scripting.
4You can see client side scripts used on a web page by checking out its source code.You can’t see server side scripts used on a web page through its source code via a web browser. For example you can’t see the PHP code used on a web page through your browser.
5Examples of client side scripting: Javascript and FlashExamples of server side scripting: ASP (Active Server Pages), PHP (Personal Home Page), JSP (Java Server Pages), Cold Fusion, Ruby on Rails, Perl etc.

Note: Ajax uses both client side and server side scripting. It is a client side script that calls a server side script.

Markup Languages

A markup language contains a series of instructions for displaying a text.

There are different types of markup languages like:

1. Document markup

2. XML markup

3. Content Syndication markup

4. Lightweight markup

5. General-purpose markup, etc

The most popular markup languages are ‘Document Markup’ languages like HTML, XHTML and RTF (Rich Text Format)

Stylesheet Languages

Also known as style languages contains a series of instructions through which you can control the layout and look of your web documents.

The most popular style language is CSS (Cascading Style Sheet).

Other popular style language is XSL (Extensible Stylesheet Language). 

To be good at technical SEO, you must have at least working knowledge of all the web programming languages.

Out of all these languages, you may find server side scripting languages to be the most challenging and difficult.

Now the billion pound question?

Attribution Modelling in Google Analytics and Beyond
Attribution Modelling in Google Ads and Facebook

Get my best selling books on Attribution Modelling

  • Learn to implement attribution modelling in your organisation
  • Understand the customer purchase journey across devices
  • Determine the most effective marketing channels for investment

 Click book covers to find out more

Where to Start?

Often people ask me how to start learning to code.

The answer is Learn ‘C’. ‘C’ is a programming language developed by the greatest programmer of all times: ‘Dennis Ritchie‘.

All the modern-day programming languages (from Java, Python, Perl to PHP) are partially or fully written in ‘C’.

All the modern-day operating systems from Windows, UNIX to Linux are majorly written in ‘C’.

So it will not be an exaggeration to say that ‘C’ is the mother of all programming languages. ‘ C’ lives in every programming language in some form or the other.

Unless you have a strong basic background in ‘C’ you will never truly understand the actual language elements used in complicated programming concepts like classes, objects, inheritance, polymorphism, exception handling etc.

So it is imperative that you learn ‘C’ before you migrate to C++, Java or web languages like PHP. Once you know ‘C’ and ‘C++’, you can learn any programming language with relative ease.

What I think you need to get familiar with, in ‘C’ or any other programming language are syntax, semantics and paradigm.

Syntax is like spelling and grammar of a programming language.

Semantics is the meaning of a programming language and paradigm is the style of programming.

Different programming languages use different syntax and paradigm to solve the same problem.

How to Start and Where to Stop

‘C’ is one of the most difficult programming languages in the world and is like a bottomless pit.

One needs a lifetime to become a good ‘C’ programmer. Programmers who are really good in ‘C’ have been doing programming for the last 10-15 years.

So it is important to be very selective here.

Try to stick to understanding the basic concepts and refrain from doing too much coding.

I know, for some of you it may be tempting to learn this and try that. But coding is not going to make money for your client, activities like marketing and conversion optimization will. So don’t get carried away and just focus on the core concepts.

Following are the topics which I think you must get familiar with, in ‘C’:

1. The C Character Set
2. Constants, Variables and Keywords
3. Compilation and Execution
4. Receiving Input
5. C Instructions
6. Type Declaration Instruction
7. The Decision Control Structure
a. The if Statement
b. The if-else Statement
8. The Loop Control Structure
a. The while Loop
b. The for Loop
c. The do-while Loop
9. The Case Control Structure
a. Decisions Using switch
b. switch Versus if-else Ladder
c. The goto Keyword
10. Functions & Pointers
11. Data Types
12. Arrays
13. Strings
14. Structures
15. Console Input/Output
16. File Input/Output

Once you have got a basic understand of these concepts then proceed to C++ (extension of ‘C’ programming language) and get a basic understanding of following concepts which are unique to ‘C++’:

1. Object Oriented Programming (OOP)
2. Classes
3. Objects
4. Data Abstraction
5. Data Encapsulation
6. Inheritance
7. Polymorphism

Book to Learn ‘C’: Let us C by Yashavant P. Kanetkar

Book to Learn ‘C++’: Let us C++ by Yashavant P. Kanetkar

These are the best books to learn the basic ‘C’ and ‘C++’ programming and I can personally vouch for them because I have read these books page by page at least 10 times.

Once you are familiar with the basic concepts of ‘C’ and ‘C++’, migrate to JavaScript and PHP.

Why JavaScript?

JavaScript is the most useful client side scripting language for any analytics professional.

All measurement and marketing tags (like Google Analytics Tracking Code, Google Adwords Conversion Tracking Code) are written in JavaScript.

Google Tag Manager is most useful when used alongside JavaScript.

To learn more about JavaScript in Google Analytics, read this article: Beginners guide to JavaScript for Google Analytics

Why PHP?

PHP is the most widely used server side language in the world (followed by ASP.Net) and it can help you greatly in your day to day SEO tasks.

Again refrain from too much coding and focus on learning the syntax, semantics and paradigm.

As a marketer/analyst, you don’t need to write full-fledged code (however that would be ideal but can take much longer to learn).

The goal here is to just understand the code (i.e. its syntax, semantics and paradigm) and how different web elements interact with each other.

That’s it. Unless programming is your bread and butter don’t spend too much time on learning to code.

This is number 1 reason why many marketers give up on coding. They tried to learn too much. It takes a lifetime to become a good programmer.

I learned ‘C’ and ‘C++’ programming languages (system programming) for 5+ years and still could learn only about 60% of it, as these languages are just too difficult and are like a bottomless pit when it comes to scope.

To be honest, there is virtually no end to learning to code. So if you dive deep , you are likely to get lost and lose the focus from doing your actual work i.e. marketing and analysis of your website.

Just stick to understanding the basic concepts (syntax, semantics and paradigm) and refrain from doing too much coding.

Buy the most basic book (if you have to; everything is available online free of cost these days) on a programming language and read it from start to finish like a novel. Big heavy books look tempting but are meant for seasoned programmers for quick reference.

Such books often teach you more than you need to know, things that you may never use in your working life. So stay away from them. Not only they will waste your time and money but also push you to give up on coding.

As a marketer nobody expects you to write a code from scratch.

But your boss/client expect you to be in a position where you can at least copy-paste code from pre-built modules or libraries and use it on a website and/or guide programmers on how to solve your tracking problem.

Where To Go Next?

If you are an experienced programmer who wants to take his technical skills to the next level or if you are a business that develops and sells  ‘SEO Tools’ then I would suggest learning Python, jQuery & JSON.

Why Learn Python?

  1. Google uses Python.
  2. Google App Engine which lets you run web application on Google infrastructure is written in Python (besides ‘Java’ and ‘Go’).
  3. Python supports multiple programming paradigms.

You can use Python as a pure object oriented language or as a powerful scripting language.

It is easy to learn and use.

Why Learn jQuery and JSON?

Both jQuery and JSON are commonly used in API calls.

If you wish to use APIs to speed up your SEO and analytics tasks then you need to be familiar with these languages.

Other Web Analytics Tools

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

About the Author

Himanshu Sharma

  • Founder, OptimizeSmart.com
  • Over 15 years of experience in digital analytics and marketing
  • Author of four best-selling books on digital analytics and conversion optimization
  • Nominated for Digital Analytics Association Awards for Excellence
  • Runs one of the most popular blogs in the world on digital analytics
  • Consultant to countless small and big businesses over the decade