Victoria
Victoria

Reputation: 911

Google AMP - displaying AMP-enabled pages only when accessed via Google search results

I have been asked to set up Google Accelerated Mobile Pages (AMP) for our news websites, so that pages will load faster on mobile devices. I've just started on this and I have a question to which I can't seem to find the answer in the official documentation.

Is the AMP version of a webpage only intended to be displayed when it is accessed via the Google Search results page? So, if a site visitor is accessing a news article on their mobile browser but they entered the site address directly into their address bar without going via Google, should they still be shown the existing (non-AMP) version of the page? So far, I've added a checkbox in our content management system which the CMS user (eg a site editor) has to tick to enable AMP for a particular site, and then in the output template files I check to see if the checkbox has been ticked, and if so, the site visitor will be taken to the AMP version of the page. So I’m a bit concerned that this means the mobile site visitor will be shown the AMP version regardless of whether or not they accessed the page via the Google search results. In the AMP documentation it says that we need to include a canonical link to link the AMP and non-AMP versions of each document together. Would this resolve the above-mentioned issue?

I noticed that The Guardian has set up their AMP implementation so that you can replace the www part of the URL with amp, and that will take the visitor to the AMP version of the page instead of the standard version. I’m not sure how they’ve done that - does anyone have any explanation of this?

Upvotes: 1

Views: 878

Answers (1)

Andrew
Andrew

Reputation: 1203

It is up to you if you want to send visitors to AMP pages or not from your website. The way The Guardian, and most other publishers, has set it up is that there is both an AMP and non-AMP page. If you visit their site directly, you will be served the non-AMP page. So only the AMP pages are served when accessed from the Google search results carousel or accessed directly by the AMP URL. The reference link is for crawlers to be able to know if there is an AMP/non-AMP page or not.

One basic way you could do what The Guardian has done is have a non-AMP page with the amphtml link reference pointing to the AMP page. ie. non-AMP Page:

mywebsite.abc/<slug to story>

AMP page:

mywebsite.abc/amp/<slug to story>

I hope this helps. What we have is for each story, there is an amphtml reference link pointing to a template that takes in the story ID and returns the AMP HTML markup for the story.

Upvotes: 2

Related Questions