How To Improve Page Speed To Pass Google’s Core Web Vitals Assessment via @sejournal, @DebugBear

This post was sponsored by DebugBear. The opinions expressed in this article are the sponsor’s own.

A fast website provides a more pleasant experience for users and can lead to higher conversion rates.

But Google also takes website speed into account as part of the Core Web Vitals and uses it as a ranking factor.

Learn how Google’s Core Web Vitals assessment works and what you can do to ensure your website loads quickly and provides a good experience once it’s loaded.

What Are The Core Web Vitals?

Google’s Core Web Vitals (CWV) aim to measure website quality and user experience.

To do that, several new metrics were developed which can be collected in the Chrome browser.

Three of these metrics form the Core Web Vitals:

  • Largest Contentful Paint.
  • Interaction to Next Paint.
  • Cumulative Layout Shift.

Largest Contentful Paint

The Largest Contentful Paint (LCP) metric measures how quickly the single biggest piece of page content appears on the page after a visitor opens a page.

You can see an example of the LCP in this DebugBear rendering page speed filmstrip, which shows what content would be visible to users at different points in time.

How To Improve Page Speed To Pass Google’s Core Web Vitals AssessmentDebugBear filmstrip showing how page content appears gradually on a website, November 2023

Here content starts showing up after just 1.27 seconds.

However, the image on the right is identified by Chrome as the LCP element, and this image only shows up 2.33 seconds after the navigation.

The Largest Contentful Paint is closely related to two other Web Vitals metrics that are not part of the Core Web Vitals: Time to First Byte and First Contentful Paint.

Time To First Byte

Time to First Byte (TTFB) measures how quickly the server responds to the request for the HTML document that’s loaded at the start of the page load process.

Without the HTML document, the browser can’t show any content or start loading any other resources.

First Contentful Paint

The First Contentful Paint (FCP) looks at how soon any content appears on the page.

Content here usually means text or an image.

However, when this milestone is reached by the page most of the content may still be unavailable to the visitor.

The FCP can’t happen until after the TTFB milestone. In turn, the Largest Contentful Paint is always greater than or equal to the First Contentful Paint.

That means that TTFB and FCP put lower bounds on the LCP and looking at these two metrics can help you understand the loading behavior of your website.

Interaction To Next Paint

Interaction to Next Paint (INP) measures how responsive a website is to user input.

It generally looks at the slowest interaction a user has on a web page.

INP reports how much time elapsed between two timestamps during a page interaction:

  1. The user input, for example, a click or keypress.
  2. The next visual update (“paint”) of the website (whether the content changes or not does matter).

For example, this filmstrip shows a “View Details” button being clicked.

The click is handled by  JavaScript code on the page and running this code takes some time. While the click is being processed the website UI remains frozen. Once the CPU processing is complete the browser renders the new content.

How To Improve Page Speed To Pass Google’s Core Web Vitals AssessmentScreenshot by DebugBear showing the steps involved in a page interaction, November 2023

Technically, Interaction to Next Paint isn’t one of the Core Web Vitals yet, but Google has announced that INP will replace the older First Input Delay metric in March 2024.

Cumulative Layout Shift

The Cumulative Layout Shift (CLS) metric checks whether page content is visually stable after it appears.

An unstable UI disorients users and can lead to unintended page interactions.

This screenshot shows an example of a layout shift that happens during the page load process.

At first, the image in the top right is not yet visible as the browser is still downloading it. Once the image appears, the size of the image element updates. In this case, the element becomes larger and therefore pushes down content that’s below it on the page.

How To Improve Page Speed To Pass Google’s Core Web Vitals AssessmentDebugBear screenshot showing layout shifts on a website, November 2023

CLS is called “cumulative” because the impact of different shifts is added up.

Originally this spanned the entire time the page was open, but this unfairly gave long-running single-page applications a poor rating. Google has now switched to the windowed CLS definition which only looks at a time window of up to five seconds.

What Is Google’s Core Web Vitals Assessment?

Google performs a Core Web Vitals assessment on your website and uses the results as a ranking signal.

If your website does not meet the Core Web Vitals, you will get a warning in various tools, for example, the “Core Web Vitals Assessment: Failed” alert in Page Speed Insights.

How To Improve Page Speed To Pass Google’s Core Web Vitals AssessmentScreenshots of page speed insights with a failed Web Vitals assessment, November 2023

The data for the Core Web Vitals assessment comes from the Chrome User Experience Report (CrUX), which collects real user data from Chrome users.

In addition to PageSpeed Insights, Google Search Console also checks your web vitals and explains what URLs aren’t considered “Good”.

How To Improve Page Speed To Pass Google’s Core Web Vitals AssessmentScreenshot of Google Search Console showing Core Web Vitals data, November 2023

What Makes A Good Core Web Vitals Assessment?

Google defines “Good”, “Poor”, and “Needs Improvement” thresholds for each metric.

Metric Good Needs Improvement Poor
Largest Contentful Paint Below 2.5 s Below 4 s Over 4 s
Interaction to Next Paint Below 200 ms Below 500 ms Over 500 ms
Cumulative Layout Shift Below 0.1 Below 0.25 Over 0.1

To get the maximum ranking benefit, your website should be rated “Good” across all three Core Web Vitals. As your website gets worse, this gradually impacts your rankings until the “Poor” threshold is reached.

How To Speed Up Largest Contentful Paint (LCP)

To improve your LCP, you need the main content of your website to load faster.

  1. Run a free website speed test to understand what is causing the main content of your webpage to lag.
  2. Receive and review the insights from the visual filmstrip and high-level performance metrics to uncover what your next steps are.
  3. Use those insights to optimize your page load speed.
How To Improve Page Speed To Pass Google’s Core Web Vitals AssessmentResult of a DebugBear website speed test, November 2023

You can then dive deeper into the specific metric by clicking on the “Largest Contentful Paint” metric title in the test result.

This will show you:

  • What page element is responsible for the Largest Contentful Paint.
  • If the LCP is an image, what the image URL is, and what request priority was used by the browsers.
  • If the LCP is an image, what other requests the image file depended on.
How To Improve Page Speed To Pass Google’s Core Web Vitals AssessmentDebugBear screenshot showing an analysis of the Largest Contentful Paint, November 2023

Request waterfalls show what resources were loaded over the network and how long they took to load. In this case, the partial request waterfall focusing on the LCP image shows that the image depends on first loading a large JavaScript file. This is a common problem and you should aim to load LCP images directly from the HTML document.

The DebugBear test result also offers many automated recommendations and ranks them by expected impact.

Screenshot by DebugBear, November 2023

How To Improve Interaction To Next Paint (INP)

Only 64% of mobile websites currently provide a Good INP experience, making it an important metric to optimize.

The INP metric can be hard to debug as it depends on a user interaction that can’t be tested as easily.

You can manually test out page interactions and measure them using the Chrome DevTools performance profile.

This works well if you know what page elements users typically interact with. DevTools is also really helpful once you’ve identified a slow interaction, as the Chrome developer tools will tell you exactly what the browser spends time on during that interaction.

The INP Debugger tool can also be handy as it automatically simulates interactions with different page elements. All you need to do is enter a website URL.

How To Improve Page Speed To Pass Google’s Core Web Vitals AssessmentScreenshot of the free INP Debugger tool, November 2023

However, the INP Debugger won’t be able to identify all interactions, especially if they are part of a longer user flow. This is where collecting real user monitoring (RUM) is useful, as it allows you to focus your optimizations in exactly the right place.

With RUM data you can see exactly what page elements most users are interacting with and whether they are experiencing interaction delays.

How To Improve Page Speed To Pass Google’s Core Web Vitals AssessmentScreenshot of real user monitoring data in DebugBear, November 2023

You can also see a RUM breakdown into its different components:

  • Input Delay.
  • Processing Time.
  • Presentation Delay.

Input Delay measures how long after the user interaction the browser started processing the user input. A high Input Delay indicates that background tasks or previous event handlers are blocking the user interaction.

Processing Time measures the actual time spent handling the user input. If this is slow, your developers need to look at what code runs in response to the interaction and how that code can be optimized.

Presentation Delay measures how much time elapsed between the event being handled and the next paint. This number can be high if rendering the page is complex, or if other CPU processing has been queued up while the interaction was handled.

How To Reduce Cumulative Layout Shift

Similar to INP, Cumulative Layout Shift can be hard to fix as it often happens when the user scrolls down the page or when additional content appears after the user clicks on a UI element.

If the layout shift happens during the initial load of the page, it’s easy to identify by:

  1. Running a page speed test.
  2. Clicking on the “Cumulative Layout Shift” metric title to see what page elements have moved.
  3. Fixing the element that is causing the shift.

For example, here, additional content was loaded causing the layout to change.

How To Improve Page Speed To Pass Google’s Core Web Vitals AssessmentScreenshot showing lab-test layout shift in DebugBear, November 2023

How To Fix Layout Shifts

To fix layout shifts, ensure that appropriately sized placeholders are in place if some content only appears later on in the page load process.

You can also work on ensuring the other content loads earlier – if the content is ready as soon as the page starts rendering then there’s no layout shift.

If your CLS score is hard to replicate you can use DebugBear real user monitoring to see what’s causing layout shifts for your real users.

In addition to looking at high-level distributions you can also look at individual user experiences and what led to layout shifts for them.

How To Improve Page Speed To Pass Google’s Core Web Vitals AssessmentScreenshot showing real user layout shift in DebugBear, November 2023

Monitor Page Speed & Core Web Vitals

If you’re struggling to pass the Core Web Vitals assessment, DebugBear monitoring can help you identify issues on your website and make sure you get alerts when there’s an issue.

Simply start a free trial and enter your website URLs. See all your page speed metrics at a glance on the dashboard. DebugBear also keeps track of Lighthouse scores and the real-user Google data that impacts rankings.

How To Improve Page Speed To Pass Google’s Core Web Vitals AssessmentScreenshot showing key page speed metrics in DebugBear, November 2023

In addition to continuously testing your website in a controlled lab environment, you can also install an analytics snippet on your site to track real user experiences.

How To Improve Page Speed To Pass Google’s Core Web Vitals AssessmentDebugBear showing real user Core Web Vitals charts, November 2023

In addition to the high-level Web Vitals overview, DebugBear RUM lets you break down user experiences by page speed, country, or web browser.

How To Improve Page Speed To Pass Google’s Core Web Vitals AssessmentDebugBear screenshot showing a real user TTFB analysis, November 2023

Having detailed lab reports and real user data allows you to get ahead of the Google CrUX data that impacts rankings and is reported with a 28-day delay. DebugBear provides powerful insights into your Core Web Vitals and helps you communicate with the rest of your team and management.

Ready to start optimizing your website? Sign up for DebugBear and get the data you need to deliver great user experiences.


Image Credits

Featured Image: Image by DebugBear. Used with permission.

3 New Metrics for Today’s SEO

Longstanding search-engine optimization metrics are becoming less informative. Many do not translate into traffic, owing to Google’s new features in search result pages, such as “People also ask,” local packs, and image packs. Moreover, AI-generated answers, called “snapshots,” will soon appear in Google’s Search Generative Experience.

Even domain authority is outdated. It attempts to assess site strength solely from backlinks despite Google de-emphasizing their importance.

So how do we evaluate modern SEO performance? Here are three of my new go-to metrics.

Brand Authority from Moz

Moz’s new Brand Authority reflects a brand’s search engine strength on a scale of 1 to 100. The metric is mainly based on the variety and volume of branded search queries, including the business and product names.

Screenshot of a table showing Brand Authority of Moz, Semrush, Hubspot's blog, and Search Engine Land.Screenshot of a table showing Brand Authority of Moz, Semrush, Hubspot's blog, and Search Engine Land.

Moz’s new “Brand Authority” reflects a brand’s search engine strength on a scale of 1 to 100. Click image to enlarge.

Brand Authority helps evaluate and compare a brand’s strength to competitors’. It’s handy for diagnosing ranking losses and gauging viral marketing and public relations campaigns.

There is no “good” Brand Authority — some niches have limited opportunities for exposure. Use the metric to compare sites and tactics. For example, a competitor gaining in rankings could have an elevated Brand Authority score that merits study.

Authority Score from Semrush

Authority Score by Semrush measures the reputation and trustworthiness of a website based on several factors:

  • The number and quality of external backlinks. Links from high Authority Score sites increase the grade.
  • How the site ranks for relevant, highly competitive keywords.
  • Red flags, such as referring domains from the same IP network and a too-high percentage of dofollow links.

Semrush’s algorithm combines those assessments and more to assign an Authority Score from 1 to 100.

It’s a relative metric for comparing domains in similar niches, not an absolute mark. Thus, like Moz’s Brand Authority, there’s no good or bad Authority Score. Use it for higher-listing sites to evaluate the ranking difficulty of specific keywords.

Screenshot of an Authority Score screen from SemrushScreenshot of an Authority Score screen from Semrush

Semrush’s Authority Score combines multiple factors. It’s a relative metric for comparing domains in similar niches. Click image to enlarge.

Visual Rank from DemandSphere

Gone are the days when Google served 10 blue links per page that matched a search query. We could actually estimate organic click-throughs based on a position!

No more. Search results now include visual and interactive elements that engage users, distract them from clicking, and encourage them to scroll deeper. Hence we cannot evaluate SEO performance from rankings alone.

Visual Rank from DemandSphere reflects “share of voice,” the pixel percentage of a search-result page occupied by a site or brand.

The tool analyzes a given query’s top 20 SERP features  — organic listings, ads, knowledge panels, images, videos, and more. It then assigns values to the features based on their prominence and visibility to searchers. For instance, top organic listings likely have higher values than sidebar ads, but lower listings could have less.

Google itself could have a high Visual Rank given the SERP sections with no external organic links, such as answers and ads.

Screenshot of a pie chart from DemandSphere showing share of voice for a given query.Screenshot of a pie chart from DemandSphere showing share of voice for a given query.

Visual Rank from DemandSphere reflects “share of voice” (SoV), the pixel percentage of a search-result page occupied by a site or brand. Click image to enlarge.

What is Google’s Knowledge Graph?

If you search for a specific company, you’ll likely see a big block of information on the right (sometimes the top) of your screen. That’s Google’s Knowledge Graph. This block – also known as the Knowledge Graph Card or Panel – contains relevant, context-specific information regarding your search, powered by the Knowledge Graph.

If you search for a specific company, the Knowledge Graph will show an almost complete profile, depending on how well they did their SEO work. Searching for a recently released movie will show posters, reviews and screening times for your local cinema. As you see, the graph is a powerful and fascinating tool. But what can you do to get your information in the Knowledge Graph?

It’s Google’s way of connecting information

Google’s core business is providing people with a correct answer to all their questions. To do that, it doesn’t just present the result that closest matches a search term, but it also makes broader connections between data. Google, therefore, collects and analyzes massive amounts of data on people, places, things and facts, and develops ways to present the findings in an accessible way. These are often rich results, like featured snippets, images carrousels or the famous Knowledge Panel mentioned in the intro of this text.

The Knowledge Graph and its panel

This is where it might get confusing: many people mix up the Knowledge Graph and the panel you see on the right-hand side of your screen. The Knowledge Graph is the engine that powers the panel that’s officially called the Knowledge Graph Card or Panel. In this card, you’ll find the most visible result of the work that the graph does. When there’s enough data about a subject, the card will be filled with all kinds of relevant facts, images, and related searches.

Check out Albert Einstein’s card in the screenshot below, and you’ll see how much information it provides.

This Knowledge Graph at the top and right side gives you all the facts about Albert Einstein

Read more: Elements of the Google search results page »

Anatomy of the Knowledge Graph

When Google released the Knowledge Graph in 2012, they made an excellent introductory video. This explains in easy-to-understand language how the graph works, and how it influences the results you get when you search for a specific term. Check out the video! It’s still as relevant today as it was then:

Examples of search results

In recent years, content presented by the Knowledge Graph has become much more interactive. Google likes to experiment with the graph, what it shows and how it’s presented. At first, it featured only static content, like images, social media profiles, and general information about the search. Today, it is continually expanding in possibilities. If you search for a movie, you can directly book tickets to see it at your local cinema. Search for a local store, and you know exactly when the busiest times are. And on mobile, the rich results are even richer!

Let’s look at some examples of Knowledge Graph listings.

Nutritional information:

Movies:

Places:

List sliders:

How do you get your content into the Knowledge Graph?

First, you need to become an authority on your subject. Find out what people search for by doing keyword research, write excellent content and make sure your site is fully optimized and mobile-friendly.

Next, you should use structured data to mark up important elements of your site to make it easier for Google to understand what it’s all about. After all, structured data in the form of Schema.org is becoming increasingly important! And finally, you should register your site with Google Search Console and My Business.

If you are a well-known person or if you own a particular company, you can claim your Knowledge Panel. After verifying, you can edit the contents of the panel to a certain extent.

Yoast SEO and the Knowledge Graph

Do you need help getting your (business) information in the Knowledge Graph? Fear no more, because Yoast SEO can help! Our Yoast SEO plugin for WordPress and Yoast SEO app for Shopify both output a complete Schema graph for your site, ready for search engines to use.

Just by setting up Yoast SEO — optionally supported by Local SEO in WordPress — and filling out the information on your site, you automatically enable the data that Google needs to fill the Knowledge Graph. After that, you can use regular SEO tactics and structured data to fill in the missing pieces. Keep in mind, though, that it’s Google that determines what it adds to its Knowledge Graph.

Conclusion

The Knowledge Graph is an important part of the search experience in Google. It powers many of the innovative new ways data shows up in the search engine. Getting your information in there is of the essence, especially if you have a business. And don’t forget to make sure that your business details are correct, you sign up for Google My Business and add everything you possibly can. Many other parts of the Knowledge Graph are generated from structured data, like reviews, movie information, events, so be sure to mark up your data in any which way you can.

Keep reading: Structured data: the ultimate guide »

Coming up next!

Search Evolution 2024: Navigating SEO’s Future Landscape [Webinar] via @sejournal, @sejournal

We’re hosting an exclusive deep dive into the evolving world of search – and you’re invited!

On November 29, join our live, roundtable discussion on the evolution of search, and learn how to navigate the changes that will shape your SEO journey next year.

This webinar features a panel of SEJ experts, led by editor-in-chief Amanda Zantal-Wiener. You’ll get insights directly from our very own SEO content strategist, as well as our senior news writer and editor.

Our team has combed through the year’s most substantial SEO developments and they’re ready to unpack what they mean for your strategies.

From tips on integrating AI into your content marketing and SEO, to the impact of SGE on SERPs, we’ve got you covered.

Meet The Experts:

  • Shelley Walsh, SEO Content Strategist: Shelley is a distinguished digital consultant with over 20 years of creative, marketing, and tech experience. In addition to her work at SEJ, she’s also been published by Moz, Econsultancy, Smashing Magazine, and State of Digital.
  • Matt G. Southern, Senior News Writer: Matt oversees strategy development for SEJ’s news department. He specializes in gathering details, checking facts, and making complex subjects easy to understand.
  • Ben Steele, Senior Editor: Ben has over six years of experience in crafting and refining SEO content. As a pivotal member of the editorial team, he spearheads the creation and development of SEJ ebooks.
  • Amanda Zantal-Wiener, Editor-in-Chief: Amanda is a versatile professional with a diverse skill set in writing, editing, and marketing. Joining the SEJ team from HubSpot, she has a proven track record with bylines featured in Thrillist, EcoSalon, and Fast Company.

Key Discussion Topics:

  • The biggest changes to the world of search in the past year, and where they’re leading: 2023 saw some significant shifts in the search landscape. From algorithm updates to user behavior changes, understanding these changes can provide crucial insights into the future of search, helping you adapt your strategies accordingly.
  • The fundamentals to focus on for next year, from the impact of SGE’s evolution on SERPs to addressing challenges with Google’s E-E-A-T guidelines: As search engine algorithms continue to evolve, a renewed focus on SEO fundamentals is essential for the upcoming year. Find out how updated search engine guidelines are redefining SEO success and learn how to align with these evolutions to boost your website ranking and visibility.
  • The leading Google ranking signals to focus on right now: In the realm of SEO, several ranking signals play a pivotal role in determining a website’s position on SERPs. Understanding the most influential Google ranking signals is key to optimizing strategies. We’ll provide valuable insights into which ranking signals and systems deserve the bulk of your attention in 2024.
  • How to integrate new AI technologies into content marketing and SEO (and where to avoid it): As AI continues to shape the digital landscape, it’s important to know how it can be used to your advantage. We’ll explore the practical applications of AI tools and technologies, and how they can significantly enhance content creation and optimization. We’ll also delve into the limitations and areas where AI might not be as effective.

Sign up now and secure your spot for this essential exploration of the evolving search landscape.

Whether you’re a seasoned SEO pro or new to the game, this session is your gateway to understanding what it takes to stay ahead in the rapidly evolving world of search.

Go (Golang): The Unsung Hero In The SEO’s Toolkit

Go is a young language compared to a language like Python, born in 2007.

It has incredible features such as fast execution speed compared to interpreted languages.

It excels in handling concurrency, making it one of the best choices among other languages.

It is easy to scale and has a great community supporting it.

As a technical SEO/SEO developer who develops various tools for automating the SEO process, one of the key points is being fast and efficient in developing and shipping code without complexity.

In these situations, Go (Golang) shines as bright as the sun.

SEO Automation

When it comes to SEO automation, there are many ways to structure the whole project.

You can write your entire app in a single language and package, or you can split your app into microservices/serverless functions and write each service using the language that performs best for it.

If you are working on a simple automation task, this isn’t your concern.

However, as the project grows, you may encounter productivity bottlenecks as an SEO developer.

Who Is An SEO Developer?

When you search to know more about SEO developers, you’ll find some sources that refer to SEO developers as front-end engineers who know about SEO.

However, we know that in an ideal website structure, the app front-end only serves as a shell for the app, not the data.

A back-end engineer is responsible for retrieving the data and returning it to the app’s front end.

The front-end is responsible for creating components with SEO in mind, such as headings, setting titles, meta descriptions, etc.

Furthermore, there are technical SEO experts who also code.

With all these statements in mind, some of us are SEO developers.

Go, JavaScript, and Python: Choose The Right Hammer Based On The Nail

As SEO pros, most of us use Python as the primary language for coding.

With Python, we can perform data analysis on our data, create charts, code web applications using frameworks like Flask, and instantly get a package that crawls the entire site for us, etc. Python is our Swiss Army knife that allows us to do anything.

But what if a new language could help us improve our productivity in some of these tasks?

There are different ways to compare these languages, including their type system, how they handle concurrency, etc.

Before anything else, I assume you are an SEO developer who knows Python/JS.

If you are new to coding as an SEO, Python is the better choice for you in most cases, rather than learning JS or Go.

Below is my preference for the task: each language can better serve me as an SEO professional:

  • Python: Analyzing data and performing ML-related tasks.
  • JavaScript: Writing Apps Script, working with Google Tag Manager as an advanced user. Interested in front-end development.
  • Go (Golang): Developing web applications. Interested in back-end development.

Go Facts

Let’s become more familiar with the Go language.

Go History

If you are reading this section, you’ve decided to learn Go as your new coding language.

Let’s briefly look at Go’s history.

Go was developed by Robert Griesemer, Rob Pike, and Ken Thompson at Google in 2007 and launched as an open-source programming language in 2009.

It’s interesting to know that it was inspired by Python (created in the late 1980s) for its simplicity.

Go Is A Compiled Language

Besides the fact that compiled languages are faster in execution than interpreted languages, when I code in Python and want to execute it on another machine, I find myself struggling to obtain the packages, resolve package conflicts, and so on.

However, with Go, I can easily build the code on my non-Linux machine for the Linux machine where I intend to run the code.

Then, I use the “scp” command-line tool to copy the executable to the Linux machine.

Go Has A Fabulous Standard Library

One of the amazing aspects of Go is that you can explore its standard library.

If you want to make a request, instead of downloading the “requests” package in Python, you can use the built-in package.

Similarly, if you want to create a web server, you can do it without installing any additional packages. In many cases, you only need to consult the Go standard library to find a solution for your problem.

Go Is Fast

When we say Go is fast, we can assess its speed from various perspectives. Here are some of these aspects:

  • Because of its simplicity, you can have a nice and fast development experience.
  • It’s an effective garbage collection that manages the memory for you.
  • Concurrency is one of the things that Go is famous for, and it’s easy to set up (unlike Python).
  • Since Go is a compiled language, you get relatively faster code execution compared to interpreted languages.

What Are The Tools For Coding Go?

There are several options for coding in Go. Below, you can see a list of these tools:

  • Visual Studio Code (VS Code) – Free.
  • GoLand – Paid.
  • Vim/Neovim – Free.

Personally, I code in GoLand, but with the IdeaVim plugin that brings Vim motions to my IDE and makes my life easier.

If you want to use VS Code, install the official Go plugin for it. If you prefer Vim/Neovim, don’t forget to install Go LSP.

How To Install Go

You can easily follow the instructions the Go website provides to install Go based on your operating system.

How To Write Hello World In Go

Let’s GO.

After installing the Go language on your computer and verifying that it’s installed, create a folder wherever you want and name it “hello-go.”

Then, on your terminal or Windows Subsystem for Linux, use the “cd” command to navigate to the folder you created.

Since you have installed Go, you can now access the Go command line on your machine.

In your command line, execute the “go mod init hello” command.

This command will create a “go.mod” file, which declares the module name, the required Go version, package dependencies, and more.

If you don’t understand it yet, don’t worry – take the time to learn it without stopping at this moment. If you’re familiar with Poetry for your Python projects, they have some similarities.

Now let’s create a file to write our code in and name it “hello.go.” If you are creating the file using your terminal, you can run the command “touch hello.go“.

Let’s open our text editor/IDE to write our first Go code. Below, you can see the code, and then I will explain it to you.

package main
import "fmt"
func main() {
fmt.Println("Hello GO!")
}

There Are Different Elements To Consider About The Above Code

  • Package name: We named it “main” to indicate that this is our main package in Go.
  • Import statement: Similar to Python, we imported the “fmt” package from the standard library, which is used for formatted I/O.
  • Main function: This serves as the entry point for Go to run our program.

Maybe now you are asking yourself, “Alireza said Go is easy, and what are the hacks above? Python is simpler, etc.”

There are typically some differences between Python and Go, but at this moment, let’s consider that we write our functions outside the main function and then call them inside the main function.

When Go wants to run our program, it knows it must run the main function. So, if there is a call to another function, it goes and runs it.

If you are familiar with languages like C, the above code will be much more familiar to you.

How To Run/Build Our Program In Go

After coding our program, we need to run it to see “Hello GO!” as the output. To do this, we run the command “go run hello.go” in the command line.

As you can see, we have our output.

As I mentioned, Go compiles our code and is not similar to Python, which uses an interpreter. Therefore, we can obtain an executable file and run it!

When we use the “go run” command, it creates the executable file on the fly and runs it without saving it. However, by executing the “go build hello.go” command, we obtain our executable file as output with the same name as the file we passed to “go build.”

After running “go build hello.go” we should have a “hello” file as the output, which is an executable file. We can run it from the terminal using the “./hello” command.

Python Code Equivalent In Go Code

Now that we know the basics let’s look at creating a variable, a for loop, making an HTTP request, etc.

Below, I will write both Python code (which I assume you are familiar with) and the equivalent code in Go for a better understanding.

The project “Golang for Node.js Developers” inspired me to write in this way. I also created a project called “Go for Python Developers” with as many examples as possible for me, so don’t miss it.

Let’s GO!

Variables

Python:

mutable_variable = 2
CONST_VARIABLE = 3.14 # There isn't a way to define a constant variable in Python
a, b = 1, "one" # Declaring two mutable variables at once

Go:

var mutableVariable int = 2
const ConstVariable float = 3.14
var a, b = 1, "one" // Go automatically assigns types to each variable (type inferred), so you can't change them later.

Besides that, the above example shows you how you can create variables in Go.

You can also see the different ways of naming variables in Go and Python, as well as the various ways of leaving a comment.

Data Types

Python:

string_var = "Hello Python!"
integer_var = 2
float_var = 3.14
boolean_var = True

Go:

var string_var string = "Hello Go!"
var integer_var int = 2
var float_var float = 3.14
var boolean_var bool = true

For loops

Python:

i = 10
for i in range(10):
print(i)

Go:

// Initial; condition; after loop
for i := 0; i < 10; i++ { // Using the shorthand syntax of declaring a variable in Go (mutableVar := the value)
fmt.Println(i)
}

While loop

Python:

counter = 0
while counter < 5:
print(counter)
counter += 1

Go:

var counter int = 0
for counter < 5 {
fmt.Println(counter)
counter += 1
}

If/Else:

Python

age = 25if age >= 13 and age <= 19:
print("Teenager")
elif age >= 20 and age <= 29:
print("Young adult")
elif age >= 30 and age <= 39:
print("Adult")
else:
print("Other")

Go:

var age int = 25
if age >= 13 && age <= 19 {
fmt.Println("Teenager")
} else if age >= 20 && age <= 29 {
fmt.Println("Young adult")
} else if age >= 30 && age <= 39 {
fmt.Println("Adult")
} else {
fmt.Println("Other")
}

Array/Slice

In Python, we are familiar with lists whose size is dynamic. In Go, there are two different concepts for Python lists. The first is an Array, which has a fixed size, and the second is Slices, which is dynamically sized.

Another important thing about Arrays/Slices in Go is that we must define the type of elements we want to store in our Array/Slice. In other words, you can have a slice of strings, not a slice of both strings and integers.

Python:

mix_list = [False, 1, "two"]

Go:

var boolArray [3]bool = [3]bool{false, true, true} // var variableName [array size]type of array elements
var stringArray [3]string = [3]string{"zero", "one", "two"}
var intArray [3]int = [3]int{0, 1, 2}
var boolSlice []bool = []bool{false} // var variableName []type of slice elements
var stringSlice []string = []string{"zero", "one"}
var intSlice []int = []int{0, 1, 2}

For loops Over Arrays/Slices

Python:

mix_list = [False, 1, "two"]
for item in mix_list:
print(item)

Go:

var intSlice []int = []int{0, 1, 2}
for index, value := range intSlice {
fmt.Println(index, value)
}

Maps

Consider Map as the dictionary that we have in Python. Similar to an Array/Slice, you must declare the type of the key and the type of the values.

Python:

the_dictionary = {"hi": 1, "bye": False}
print(the_dictionary["hi"])

Go:

var theMap map[string]int = map[string]int{"hi": 1, "bye": 0}
fmt.Println(theMap["hi"])

HTTP Get Request

Python:

import requests
response = requests.get("https://example.com/")
print(response.content)

Go:

import (
"fmt"
"io"
"log"
"net/http"
)
resp, err := http.Get("https://example.com/")
if err != nil {
log.Println(err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
fmt.Println(string(body))

Conclusion

If you are interested in learning Go, you can check the Go by Example website (I considered its hierarchy of examples for this article) and the Go Tour.

Hope you enjoy coding in Go, and happy learning!

More resources: 


Featured Image: ShadeDesign/Shutterstock

How To Always Survive Algorithm Updates Using AI: The Ultimate Search Engineer’s Guide via @sejournal, @mktbrew

If you’ve ever felt like you’re on a rollercoaster ride with Google’s ever-changing algorithms, you’re not alone.

Google’s Core Algorithm Updates are known for keeping you on your toes, and it’s become increasingly challenging to keep up – not to mention get ahead.

These algorithmic shifts have the power to make or break your website’s performance, so it’s crucial that you understand the specifics of each new update, its effects, and the right course of action.

But how do you stay on top of these search engine updates and optimize your SEO strategy for success?

How do you take advantage of each algorithm change and turn it into an opportunity to rank higher?

In this comprehensive guide, we’ll show you how.

How To Understand Each New Google Core Algorithm Update

Whenever Google rolls out a new update, you no doubt ask, “So, what changed this time?”

And as an SEO professional, your entire strategy rests on the answer to this question.

The impact of an algorithm update can be unpredictable – a change that benefits one website might harm another.

Therefore, it’s important to stay fully informed and continually adapt your SEO strategies to remain competitive.

The key to surviving Google’s constant algorithm shifts is understanding:

Make sure you’re analyzing official statements from Google and only consulting reputable industry resources for insights into the latest algorithm updates.

It’s also important to stick to data-based evidence. (For instance, a report measuring an increase in ranking correlation for a particular algorithm.)

These correlations can be used to uncover patterns that reveal which strategies are effective after the update.

But of course, the buck doesn’t stop at simply understanding each Google algorithm update – there’s much more involved in keeping your website’s rankings intact amidst the changes.

Let’s break down the essential steps needed for you to start mastering Google’s Core Algorithm Updates.

Step 1: Collect & Analyze Pre-Update Data

The data-collection stage helps to form the foundation for your analysis post-update – so the more data you have, the better you’ll understand the update’s effects.

As soon as you hear that a new algorithm is going to be released, you’ll want to start gathering data on your website’s landing pages, including:

  • Rankings.
  • Organic traffic.
  • Backlink profiles.
  • On-page elements.

You’ll also want to segment the pages into relevant groups based on content, keyword focus, or user intent.

Maintain Focus On Your SERP Competitors

But don’t forget about your competitors!

While focusing on your website is important, it’s also crucial to keep an eye on how your competitors are doing.

Be sure to collect data not only on the sites that rank above you but also those below you in the SERPs, as this information will help you identify trends and changes across the landscape.

It’s best to use a tool to help automate the data collection process and provide more comprehensive results.

Pro Tip: There’s a newer SEO technology that many of the more competitive digital marketing teams are using: the search engine model.

Use Search Engine Models To Enhance Your Strategy With Data-Driven Insights & Predictions

Search engine models allow you to define, create, and deploy statistical replicas of any search engine environment.

They’re basically a map that you can use to navigate Google’s algorithms.

These models essentially work by simulating the complex algorithms and ranking factors used by search engines to predict the order in which websites appear in search engine result pages (SERPs).

As one of the leading providers of search engine modeling technology, Market Brew has the advanced tools you need to predict ranking changes with each optimization you do.

Here’s how we recommend you use this technology to collect and analyze your data:

  1. Build 2-3 search engine models for each major area or template of your site. This will give you a representative sample of models that should give you guidance for all of the pages that use that same template. (When a company like Walmart uses Market Brew, they don’t create a million models. They focus on building guidance for each template, which means at a minimum 2-3 models for landing pages/ keywords that use that template.)
  2. Group the models logically into teams. For instance, the models that center around landing pages that use one particular template could be placed together in the same team, to ensure recommendations within a group are consistent, and will allow you to spot patterns that are specific to issues with that part of the site.
  3. By adding the search engine models now, your team will be tracking each competitor site’s history as well. Your team can even tap into Market Brew alerts to be notified when your competitors change their content/ link strategy. Every input and output of every modeled algorithm will be available to you now.

Get the full checklist and make sure your strategy stays on track.

Step 2: Monitor Post-Update Changes & Assess The Impact

To really know the effects of an algorithm change, you’ll need to monitor the rankings and organic traffic of your landing page groups after the update.

Don’t forget to also collect the data for each landing page that shows up in your SERPs – this way, you can sort the winners and losers when all is said and done.

If you’ve set up your search engine models, it’s important to regularly re-calibrate them (preferably every 90 days or so) to reflect the latest ranking changes.

Be sure to track and visualize the changes in weights for each modeled algorithm before and after the update.

Also look through your models to ensure that top-performing sites in these boosted algorithms continue to perform well in their respective SERPs, and sites that were doing poorly are now performing worse.

Conduct An Analysis Of How The Algorithm Update Affects Rankings

From here, you’ll want to conduct a statistical analysis:

  1. Analyze the relationship between ranking changes and each of your SEO software’s algorithms. Create a “fitness” equation that provides a prioritization of tasks based on your team’s objectives, like sorting by task ROI.
  2. Identify patterns and correlations that reveal which strategies are impacted by the update. Copy the winning patterns and remove or replace the losing patterns.
  3. Understand that there could be a confluence of algorithm changes that have caused issues with your landing pages, and not just one specific algorithm change.

Keep up with your progress with this checklist to keep you on task.

Step 3: Adapt Your SEO Strategies & Priorities For Success

So you’ve collected and analyzed your data – now, it’s time to take action.

Start adjusting your SEO strategies based on your statistical analysis from step 2, making sure to emphasize factors that show strong correlations with improved rankings.

SEO: How to Target Countries

Targeting international consumers in organic search requires a few extra steps. Here are seven tips for higher rankings in the countries of choice.

1. Set up separate sites or sections for each country

To ensure a site ranks in organic search results in more than one country, the options are:

  • Create a separate site for each country using country-specific top-level domains (e.g., .de, .uk, .in). Registering all local TLDNs might not be practical, given the cost, restrictions, and unavailability.
  • Use a subdomain for each country (e.g., de.yoursite.com). Setting up subdomains requires development and search-optimization resources, such as building links to each subdomain.
  • Set up a subdirectory for each country (e.g., yoursite.com/de). Creating directories for each country is often the best approach because the single domain receives all the authority.
  Yoursite.de De.yoursite.com Yoursite.com/de
Targeting Strongest signal, but targets only one country Strong signal, easier to separate sites Strong signal in combination with hreflang
Different server locations Yes Yes No
Maintainence Difficult to maintain Medium Easiest to maintain
Use case Have a local office and marketing team Can afford to build authority for each subdomain Target many countries but cannot afford separate entities

2. Use hreflang

Google introduced hreflang in December 2011 to replace its geo-targeting settings inside Webmaster Tools (now Search Console). Hreflang is an HTML attribute — “lang” is language — that helps search engines recognize localized versions of web pages.

3. Translate content to local language

The language of your content is another key indicator to Google as to the country you’re targeting. Google auto-detects language easily. Beyond investing in quality (human) translation, there’s no further action required.

If you are targeting same-language countries, use a region-specific variation for each. A local translator can help.

4. Include location info on the website

Including in the website an address in the country you are targeting helps Google recognize the importance of that locale. This presumes your company has a local physical location or your content addresses one.

5. Attract inbound links from local sites

Google still relies on inbound links to determine the popularity of a website and where to rank it in results, especially when a query has local intent. When targeting another country, launch a local link-building program, perhaps focusing on local journalists.

6. Inform Google Business Profile

If you have a local office, point your Google Business Profile to the regional site.

7. Consider Local Hosting

The location of a web server is a low-level signal to Google, especially for generic top-level domains, such as .com or .net. The larger benefit of hosting near a target market is page speed to those consumers’ browsers.

Some countries, such as Australia, require a license or even a local business presence to host there, making it complicated and expensive. Check local hosting requirements when planning multi-country search optimization.

SEO for SGE

Google’s Search Generative Experience provides AI-generated answers to queries. It’s conversational AI search, in other words, an AI-driven answer engine. Bard, Google’s AI chatbot, powers SGE.

Google launched a limited SGE trial in May 2023 and has since finetuned the layout and responses. A full worldwide rollout is coming, making SGE the future of search.

With that in mind, here are my observations based on extensive SGE testing.

Organic Results

Google’s organic results are not going anywhere, although AI-generated responses:

  • Push organic results further down the page,
  • Include visual elements such as related images and videos,
  • Add links as references for additional info.

SGE’s AI answers are featured snippets on steroids. The answers include “Ask a follow-up,” encouraging searchers to explore the topic further.

Unlike featured snippets, SGE’s answers:

  • Include products, maps, and other info based on the perceived search intent,
  • Surface user-generated content such as Reddit threads, Quora answers, and customer reviews.

Moreover, SGE answers don’t always answer the query. For example, searching for “best laptops” in SGE includes results such as:

  • “RAM vs. Processor — Which Is More Important to Your Business?”
  • “What is the importance of a keyboard mouse with a computer?”
  • “Computer Basics: Laptop Computers.”

Those results may help a searcher make an informed decision, but they don’t directly respond to the initial query of recommending a laptop.

SGE’s results for “best laptop” include responses unrelated to purchasing. Click image to enlarge.

In June, I reviewed AI-powered search engines. Instead of simply ranking results based on their relevance to a query, AI search provided a wider range of answers. That, I concluded, was the future of search. The latest version of SGE confirms that prediction.

SEO for SGE

SGE uses Google’s existing framework and infrastructure, such as:

  • Indexed web pages,
  • Knowledge graph, including known entities and associated concepts,
  • Shopping results from Google Merchant Center using sellers’ product feeds,
  • Map results from Google Business Profile, formerly Google My Business.

Thus optimizing for organic search is largely unchanged:

  • Create relevant content addressing the needs of your target customers,
  • Optimize product pages and categories based on those users,
  • Structure the site to surface pages based on the audience,
  • Use Google’s submission tools to ensure content is indexed and thus visible to Bard.
  • Obtain external backlinks, as they drive Google Discover and the knowledge graph, among other benefits. Backlinks are especially important for co-citation links in SGE’s results, which place your site next to known entities, thereby making the association.

Google will likely alter SGE many times before the public launch. But SGE’s fundamentals remain and will continue relying on Google’s data. It will encourage clicks to external sites. Despite popular belief, it is not in Google’s interest to keep searchers on its site. Google’s entire revenue model (advertising) relies on clicks.

Organic Search Changes

What will change?

Organic search results will likely become more unpredictable. Thus far, SGE’s answers differ depending on the searcher, making it seemingly impossible to know what folks clicked on to reach a landing page.

Buying journeys will be more complicated. This trend is not new, as Google increasingly serves diverse results that distract searchers from their initial intent. The dynamic nature of AI answers will produce even more extended search journeys.