Can I use AMP (Accelerated Mobile Pages) components/tags on a page that is not a valid AMP page?

927 Views Asked by At

Can I use AMP (Accelerated Mobile Pages) components/tags on a page that is not a valid AMP page?

Will I have advantages or disadvantages with this? Is it a good practice or not?

I would like to use the AMP components/tags by the way it load the elements (like amp-carousel and amp-img), but I can not fully convert my website to AMP since I have custom javascript codes that AMP page dont allow that I use (that do not apply using amp-iframe).

Is it better for me to keep standard elements and other libraries, or is it valid for me to use AMP components even though the page is not a valid AMP page?

Thanks!

2

There are 2 best solutions below

0
On BEST ANSWER

The major advantage of AMP is making the loading time better. You can achieve that by getting rid of Javascript, replacing img with amp-img etc. AMP offers plenty of it's own JS implementations for example for Twitter, Google Analytics, Pinterest and so on. See here: https://www.ampproject.org/docs/reference/components

Here you can find the information, that custom Javascript is restricted: https://www.ampproject.org/how-it-works/

If you don't want to resign from custom dynamic content, you can have two versions of you page and link them in <head>.

Disadvantages of having not fully AMP conform page? I think that Google might not index AMP pages that are not fully valid with AMP validation rules.

0
On

I don't think this is going to work as one of the design principle of AMP is to Keep all third-party JavaScript out of the critical path, meaning no author-written Javascripts except those specified by AMP Pages. So it's either you have an AMP version of your website or a non-AMP (canonical) version.