Generate metrics and graphs on how this website performs on Google. For now, the focus is mostly on Google Search Console, as that is the biggest source of traffic. πŸ–₯ Programmatically Access Google Search Console Data is used as a basis for this product.

All source code can be found here.

There is an alternative project in progress about Search Metrics in VSCode.

The main concept is the generic Metric class which contains the different steps of a data processing pipeline:

  • Define input to get data from the Google Search Console API
  • Fetch data from the Google Search Console API (this is a generic step that is the same for each metric)
  • Process the raw data
  • Display the data

Features

  • Generate a graph of default data throughout time
  • Get the most impactful pages based on impressions

Generate a graph of default data throughout time

This is the same visualisation as on Google Search Console itself, but it’s used as a starting point for further features (implementation).

Get the most impactful pages based on impressions

The main idea is to add page as a dimension in the input:

{
    'dimensions': ['page']
}

The implementation can be found here.

An example of the output:

Most impactful pages:
Impressions: 1290       (46.25%)        https://www.turtlestoffel.com/the-state-of-kotlin-and-vscode/
Impressions: 546        (19.58%)        https://www.turtlestoffel.com/google-search-console-api/
Impressions: 278        ( 9.97%)        https://www.turtlestoffel.com/easy-integration-testing-in-kotlin-with-spring-boot-and-wiremock/
Impressions: 168        ( 6.02%)        https://www.turtlestoffel.com/getting-the-most-out-of-todoist-through-apis/
Impressions: 110        ( 3.94%)        https://www.turtlestoffel.com/formatters-in-the-kotlin-ecosystem/

A neat little trick to align the percentages is to use additional formatting parameters in f-strings:

{page["percentage"]:5.2f}