Utilizing Python for Demonstrating Homepage Redirection to Executives (Or Any SEO Optimization)

Utilizing Python for Demonstrating Homepage Redirection to Executives (Or Any SEO Optimization)

Having difficulty convincing your team to adopt SEO best practices for redirecting homepages using data science? Discover how Python can assist in estimating the potential PageRank improvement.

If you work in SEO, you may come across a situation where the home page of a website redirects to a subdirectory. This could be redirecting to a country-specific version of the site or using placeholder content that links to the main site's home page in a subdirectory.

In these scenarios, you might find it challenging to convince your client or colleagues to adhere to best practices. If you're facing this dilemma, then this article is tailored for you.

I will demonstrate a method to effectively communicate with C-suite executives in a way that resonates with them both technically and commercially, using data-driven examples.

To achieve this, I will guide you on using Python to calculate the TIPR of all website pages. This will allow you to present a comparison of the performance before and after implementing your proposed changes, providing a solid justification for your recommendations.

We will cover:

Hosting Placeholder Pages On The Root and Root Redirects.

Why The Home Page Should Be Merged With The Root.

The struggles of communicating the benefits to non-SEO expert leadership.

Using Python to estimate PageRank uplift.

Using Python model traffic impact from PageRank uplift.

Using A Data-Driven Approach Is More Persuasive To C-Suite.

First of all, let’s discuss why the home page should be merged with the root.

Hosting Placeholder Pages On The Root and Root Redirects

Some sites host a placeholder page on the root URL or, worse, redirect the root to a subdirectory or page. 

Many well-known brands, particularly in the fashion industry, have websites that cater to different regions, with each regional store located in its respective regional folder. For instance, if you visit Gucci's website, you will come across various stores:

UK: https://www.gucci.com/uk/en_gb/.

USA: https://www.gucci.com/us/en/.

France: https://www.gucci.com/fr/fr/.

…and so on.

In Gucci's situation, there is a regional folder and a language folder, which makes sense.

Living in London means that when I visit https://www.gucci.com/, I am directed to the UK store.

When you search for Gucci on their website (site:gucci.com), you will see that the main folder is included in the search results and you can choose your region from a store selection menu.

Usually, for most websites, the main folder will redirect you to their default or most popular regional store.

The Importance of Merging the Home Page with the Root

Search engines rely on authority to gauge a page's significance on the internet. This authority is determined by the likelihood of a page being linked to by other websites. Consequently, the greater the authority a page possesses, the greater its potential to rank higher in search engine results pages (SERPs).

Most websites tend to receive the highest number of links to their main homepage. This is where the search engine ranking power is concentrated.

However, this setup is not ideal for the overall site architecture. It results in the product listing pages (PLPs) and product description pages (PDPs) being one step further away from the main homepage.

This additional step may seem minor, but it actually makes a significant impact, as we will show and measure later on.

Now, let's imagine the connection map of websites that have placed their homepage in the main directory.

Here is a website where the main URL has a page-level authority score of 40 PR, which then redirects to the English language store with a score of 21 PR. From there, you can access all the product listing pages (PLPs) and product detail pages (PDPs).

Root URL has a page level authority score (according to Ahrefs) of 40

Root URL has a page level authority score (according to Ahrefs) of 40

All images are from the author, dated April 2024.

When users click on the blue logo on any page, they will be directed to their regional store homepage. This includes other regional homepages shown in pink. This ensures that the value of the regional homepage is not artificially inflated by linking to the root URL.

The pages on site level 2, directly linked from the home page, have a page level rating of 19 PR. On the other hand, the pages on site level 3 have 18 PR.

Another thing to consider is that these pages are one step away from the root URL. This means they do not receive all the authority they could potentially get.

When you make copies of a copy instead of the original music, the sound quality deteriorates. This is similar to what search engines experience when evaluating the importance of your site content.

If the stores are connected to the root URL, it can cause a problem by creating a lot of redirects throughout the site, which can waste the authority distribution.

To avoid this issue, it is recommended to merge the root with the home page. This way, all site pages will be closer together and there will be one less step for users to navigate through.

merging the root with the home page

merging the root with the home page

Image from author, April 2024

Many SEO professionals face challenges when trying to explain the benefits of their work to non-SEO expert leaders.

To your marketing and IT colleagues who are not familiar with SEO, all this may seem complicated and hard to believe.

They might be more curious about how it affects website traffic and revenue, rather than the technical details shown in the diagrams above.

They probably have no idea of Google’s PageRank metric for measuring page authority and don’t care unless you provide the numbers.

Using Python To Estimate PageRank Uplift

With the help of data science, we can use Python to easily calculate the new PR values for the root URL following the recommended approach. Let's consider the PageRank formula:

PR(A) = (1-d) + d (PR(T1)/C(T1) + ... + PR(Tn)/C(Tn))

As explained in The Anatomy of a Large-Scale Hypertextual Web Search Engine by the founders of Google:

Page A is assumed to have pages T1...Tn that link to it, which are known as citations. The damping factor d can be set between 0 and 1, with the typical setting being 0.85. Additionally, C(A) represents the number of links that lead away from page A.

It is important to note that PageRanks create a probability distribution across web pages, ensuring that the total sum of all web pages' PageRanks equals one.

The main idea behind the formula is that the PageRank of a URL (A) depends on the PageRank of the pages linking to it (Ti) and the number of internal links on those pages C(Ti).

You can find the Python version of the PageRank formula here.

With the knowledge of the above formula in mind, we can anticipate the following benefits:

The new home page will see improvements by ensuring that all pages link to the root URL (PR Ti) and share other internal links C(Ti).

All site pages will benefit from the stronger parent URL (the new merged home page in the root URL).

Now, we just have to reevaluate the overall impact of merging the /en folder with the root URL on the entire site, which will be done in multiple phases.

To calculate the TIPR of all site pages, you need to combine the internal PageRank from site auditing software with the external PageRank from the internet using tools like Ahrefs. This will give you a comprehensive view of the overall ranking of your site pages.

Next, calculate the new TIPR of the new home page by merging or migrating the /en page with the root URL. This will help determine the updated ranking and visibility of your home page.

Calculate the new TIPR of all subsequent and remaining pages on the website.

As shown in the diagrams above the new best practice configuration shows the new TIPR values of all pages.

Using Python to Analyze Traffic Impact from PageRank Boost

After completing the TIPR calculation process, the next step is to explain the SEO improvements in a way that shows how they can positively affect the business. This will help you get support from your team members.

One way to measure success is by analyzing organic search traffic in relation to TIPR. By utilizing machine learning and a large dataset (about 10,000 data points), this analysis can be effectively conducted.

Before recalculating TIPR, you will need to input the dataset. This dataset should include the TIPR column and the search clicks data, which can be obtained from Google Search Console.

The chart below visualizes the relationship between TIPR and clicks.

Relationship between TIPR and clicks: Blue line model

Relationship between TIPR and clicks: Blue line model

Image from author, April 2024

The blue line is an approximate model indicating how many more clicks a page would receive with an increase in unit PageRank.

Mathematicians like to say, "All models are wrong but some are still helpful." Despite this, using the Python predict() function with your machine learning model can provide some credibility to your predicted increases. An example can be found here.

In this scenario, we can observe that for up to 20 TIPR, there is a traffic uplift of 0.35 visits per month per page, while beyond 20 TIPR, the uplift increases to 0.75 visits.

Why Using a Data-Driven Approach is Convincing for C-Suite

When it may not seem like a significant change, the impact can be substantial when looking at the big picture. By analyzing data across numerous indexable URLs, we predicted a boost of 200,000 monthly visitors for a single client.

This forecast boosted their confidence and motivated them to act on the repeated advice they received from several SEO consultants to set the home page as the root.

The key difference lies in the measurement, both in terms of technical aspects and commercial considerations.

By using TIPR and the PageRank formula to model a scenario for your technical SEO suggestion, such as designating the root URL as the homepage, your SEO strategy becomes data-focused and more compelling.

This data-driven approach not only enhances your technical skills but also has the potential to boost your business success, allowing you to implement more SEO recommendations and advance in your career.

By taking a data-driven approach, you can also validate your best practice recommendations that you come across online. It's important to remember that the top SEO professionals test ideas instead of blindly adhering to established best practices.

More resources:

URL Redirects For SEO: A Technical Guide

Using Python + Streamlit To Find Striking Distance Keyword Opportunities

The Complete Technical SEO Audit Workbook

Featured Image: BestForBest/Shutterstock

Editor's P/S:

This article offers a practical approach for SEO professionals to effectively communicate the importance of merging the home page with the root URL to non-SEO expert leaders. By utilizing Python to calculate the TIPR of all website pages and estimate the traffic impact from PageRank uplift, SEO professionals can provide data-driven evidence to support their recommendations. This data-driven approach not only enhances the credibility of SEO strategies but also demonstrates the potential for significant business impact, making it more persuasive to decision-makers.

Furthermore, the article emphasizes the importance of questioning established best practices and conducting data-driven analysis to validate SEO recommendations. By embracing a data-focused mindset, SEO professionals can gain a deeper understanding of website performance and make informed decisions that drive tangible results. This approach not only benefits the technical aspects of SEO but also aligns with the commercial objectives of businesses, fostering a collaborative environment where SEO professionals can effectively contribute to the overall success of their organizations.