Start » Web sites » Design » Google AMP case study

Google AMP case study

Gathering data is in progress – I plan to conclude the study on the 31st of July, 2022.
I wrote in great detail about what AMP is (including the pros and cons), as well as how to implement AMP on a WordPress website. After having been running AMP for years, I’ve decided to do a case study, testing website performance once it is removed – tracking all the relevant metrics (visitors, average page load times etc.).

Table Of Contents (T.O.C.):

  1. Introduction
  2. How to disable AMP for WordPress
  3. AMP case study test setup
  4. AMP enabled – statistics
  5. AMP disabled – statistics


1. Introduction

I’ve been running AMP for years, being one of its early adopters. It looked very promising: offering faster page-load times for smartphone users with slower and/or limited Internet bandwidth. This is achieved via well-optimized content (with stricter limits on what can, and what can’t be used), and also by serving the (cached) AMP-content versions from Google’s servers (this last option has been “discontinued” in the meantime).

The downside is it’s quite limiting in terms of website functionality and design options it allows. Also, it is an extra complication for website maintenance (requires extra time to test everything upon WordPress updates for example).

Another downside is that I can’t control Google AdSense ad placement with AMP. So the ads get placed in between article paragraphs. This does earn more money, but it is distracting for the readers. Sure – a non-AMP website version is only one click away, and the ads get loaded only after all the text and article images have been loaded, but it’s still not perfect. I can only turn off the AMP ads completely. That also doesn’t sound right: I’m making some great content, offering it for free, and the least I can do is make some income from the ads – at least enough to cover my expenses.

I’ve also heard rumours that Google is planning to ditch the AMP project support altogether. For example, AMP statistics is still not implemented in Google Analytics Version 4, and the deadline for implementing the V4 instead of the old version is July 2023 (so roughly a year from now).

While I remain very sceptical about Google ditching this project, I think it doesn’t hurt to do a test and see how my site(s) perform without AMP. Just to be prepared for anything.

For testing, I’m using my cycling website version in my native. Why? Mobile Internet speed in my country is still relatively poor, plus I’m bound to get some high-quality feedback from users (even if it includes my mother and a dog in the same sentence 🙂 ).

– T.O.C. –


2. How to disable AMP for WordPress

My websites are configured to use a query parameter for AMP content versions. Thanks to this, once AMP is disabled, all the potentially existing links to the AMP will automatically show the matching non-AMP content version as if nothing had happened practically.

Still, to be on the safe side, and speed up the re-indexing process, I’ve added this .htaccess redirect:

#BEGIN Redirect from AMP to non-AMP
RewriteCond %{QUERY_STRING}    "amp=" [NC]
RewriteRule (.*)  /$1? [R=301,L]
#END Redirect from AMP to non-AMP

That redirection is a “permanent” one (“301 redirection”) that redirects visitors to any AMP pages (that end with a “?amp=1” suffix) to a matching non-AMP page version (with the same link, just without the suffix).

So, practically all I had to do was disable the WordPress AMP plugin, comment-out any AMP-related WordPress child theme code, and add the above-shown code to the .htaccess file on my hosting server.

If it’s of any help, here’s my AMP-related WordPress child theme code:

/*
BEGIN DISABLING AMP - EXPERIMENT

// BEGIN disable header Element for AMP
add_filter( 'generate_element_display', function( $display, $element_id ) {
    // Tell the non-AMP Element not to appear.
    if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() && XXXXX === (int) $element_id ) {
        $display = false;
    }

    return $display;
}, 10, 2 );
// END disable header Element for AMP

// BEGIN ads for AMP - goes into footer
$print_amp_auto_ads = function() {
  $ad_client = 'ca-pub-XXXXXXXXXXXXXXXX'; // @your client  ID
  if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
    ?>
    <amp-auto-ads type="adsense" data-ad-client="<?php echo esc_attr( $ad_client ); ?>"></amp-auto-ads>
    <?php
  }
};
// For Paired/Native mode.
add_action( 'wp_footer', $print_amp_auto_ads );
// END ads for AMP - goes into footer

// BEGIN comments for AMP - goes after main content
$gremlin_amp_comments = function() {
  if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
    ?>
<p>Ako imate <strong>problema sa postavljanjem komentara</strong> (sa mobilnog),<br />posetite stranicu za <a title="Pitanja &amp; Odgovori" href="https://bicikl.bikegremlin.com/10435/pitanja/" target="_blank"><strong>Pitanja &amp; Odgovore</strong></a>.</p>
    <?php
  }
};
// For Paired/Native mode.
add_action( 'generate_after_main_content', $gremlin_amp_comments );
// END comments for AMP - goes after main content

END DISABLING AMP - EXPERIMENT
*/

– T.O.C. –


3. AMP case study test setup

The test setup is quite simple. I’ll compare Google Analytics stats for a 45-day period with AMP enabled, then I’ll disable AMP, give it a few days to settle and re-index, and track stats with AMP disabled for 45 days.

  • AMP enabled 45-day period: May 1st 2022 – June 14th 2022.
  • AMP disabling: June 15th 2022.
  • AMP disabled 45-day period: June 17th 2022 – July 31st 2022.

For tracking performance, I’ll be using Google Analytics, since it provides feedback from real user experience, unlike generic tests.

The testing period aligns with the cycling season in my country, so I don’t expect to see any seasonal fluctuations affect the test results.

– T.O.C. –


4. AMP enabled – statistics

Here are the visitor stats with AMP enabled:

45-day stats for the number of visitors and pageviews with AMP enabled
45-day stats for the number of visitors and pageviews with AMP enabled
Picture 1

And here are the page load times:

45-day stats for the average page load time with AMP enabled
45-day stats for the average page load time with AMP enabled
Picture 2

– T.O.C. –


5. AMP disabled – statistics

Gathering data is in progress – I plan to conclude the study on the 31st of July, 2022.

– T.O.C. –

Leave a Comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.