Support » Plugin: AMP » Is this Website is amp Compatible?

Viewing 15 replies - 1 through 15 (of 40 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    1) I have installed Amp plugin. I have activated transitional mode in the plugin which contain amp and non-amp versions. Please see this link and tell me that this is in amp or not.
    http://creativesystems.0438cfd.netsolhost.com/category/creativesystem-blog/?amp

    The AMP plugin is running but there is a conflict with some plugin/module you are using for minification. So you can see there are a couple AMP validation errors due to this: https://validator.ampproject.org/#url=http%3A%2F%2Fcreativesystems.0438cfd.netsolhost.com%2Fcategory%2Fcreativesystem-blog%2F%3Famp

    It appears to be a conflict with W3 Total Cache. Try turning of JS and CSS minification. Ideally there should be some filter that the plugin provides to conditionally disable this, but I’m not familiar with their codebase. Ideally there’d be some filter like w3tc_js_minify_enabled and you could turn it off only on AMP pages like this:

    add_filter( 'w3tc_js_minify_enabled', function( $enabled ) {
        if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
            $enabled = false;
        }
        return $enabled;
    } );

    2) If user comes from organic search in mobile, then he will find this website with amp link or not?

    The search result will not be presented as AMP until it has been indexed as an AMP page without any validation errors. There are currently 2.

    3) Can I make this website home page in amp or not?

    It depends on your theme. It doesn’t appear to be working currently: http://creativesystems.0438cfd.netsolhost.com/?amp

    Since it is not working, you can uncheck the “Serve all templates as AMP” checkbox and only enable the Singular checkbox. Otherwise, you’ll have to look at the AMP validation errors that are being reported for the homepage when you click “Validate” in the admin bar. I’m expecting there are issues with excessive CSS and invalid scripts.

    Thread Starter adil1641

    (@adil1641)

    Hi @westonruter ,
    add_filter( ‘w3tc_js_minify_enabled’, function( $enabled ) {
    if ( function_exists( ‘is_amp_endpoint’ ) && is_amp_endpoint() ) {
    $enabled = false;
    }
    return $enabled;
    } );

    1) This code is for both css and js and will applied in which file ?
    2) and by applying this code css minification will be removed only for amp version not for non-amp version?
    3) “The search result will not be presented as AMP until it has been indexed as an AMP page without any validation errors. There are currently 2.” I did not understand about this thing you are saying there are currently 2 validation issues for indexing an amp page?

    Please guide me about these things?

    • This reply was modified 2 years, 9 months ago by adil1641.
    Plugin Author Weston Ruter

    (@westonruter)

    1) This code is for both css and js and will applied in which file ?

    Code like that would need to you in your custom theme’s functions.php or a custom plugin. However, this code will not work as-is. You need to contact W3 Total Cache regarding the specific filter code to use.

    2) and by applying this code css minification will be removed only for amp version not for non-amp version?

    Correct. The intention is to only disable for the AMP version, since the AMP plugin does minification of CSS already and custom JS is removed.

    3) “The search result will not be presented as AMP until it has been indexed as an AMP page without any validation errors. There are currently 2.” I did not understand about this thing you are saying there are currently 2 validation issues for indexing an amp page?

    Yes, there were 2 validation errors when I looked at your AMP page (one due to a stylesheet link and another due to custom JS). You can see them here: https://validator.ampproject.org/#url=http%3A%2F%2Fcreativesystems.0438cfd.netsolhost.com%2Fcategory%2Fcreativesystem-blog%2F%3Famp

    Thread Starter adil1641

    (@adil1641)

    Hi @westonruter , I have one more question. Is Amp works only on SSL or not?

    Thread Starter adil1641

    (@adil1641)

    Hi @westonruter, facebook pixel code and google optimizer is removed in amp version. Why it is removed. It is necessary for website. Please see source code of both amp and non-amp versions.

    http://creativesystems.0438cfd.netsolhost.com/?amp
    http://creativesystems.0438cfd.netsolhost.com/

    Please guide me about this one

    Plugin Author Weston Ruter

    (@westonruter)

    I have one more question. Is Amp works only on SSL or not?

    AMP doesn’t strictly require HTTPS, but some things will not work without it (e.g. iframes). You really should ensure the site is running on HTTPS.

    facebook pixel code and google optimizer is removed in amp version. Why it is removed. It is necessary for website. Please see source code of both amp and non-amp versions.

    AMP does not allow custom JavaScript, so this is why they are being removed.

    Nevertheless, notice how the non-AMP version of Facebook Pixel includes:

    <noscript><img height="1" width="1" style="display:none"
    src="https://www.facebook.com/tr?id=1929018283986357&ev=PageView&noscript=1"
    /></noscript>

    While the AMP plugin removes custom scripts, also automatically unwraps noscript elements so their contents become the AMP version by default. I was expecting to see this:

    <!--noscript--><amp-img height="1" width="1" src="https://www.facebook.com/tr?id=1929018283986357&ev=PageView&noscript=1" class="amp-wp-enforced-sizes amp-wp-6a19fc1" layout="intrinsic"><noscript><img height="1" width="1" src="https://www.facebook.com/tr?id=1929018283986357&ev=PageView&noscript=1" class="amp-wp-cb45893"></noscript></amp-img><!--/noscript-->

    However, I’m not seeing on it on your site. Perhaps you are using a plugin is not adding it intentionally. In that case, what you should do is add code like this to your custom theme’s functions.php or a custom plugin:

    add_action( 'wp_footer', function() {
    	if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
    		?>
    		<amp-pixel src="https://www.facebook.com/tr?id=1929018283986357&ev=PageView&noscript=1" layout="nodisplay"></amp-pixel>
    		<?php
    	}
    } );

    Instead of amp-pixel, you may also be able to use amp-analytics here. For more information, see https://amp.dev/documentation/guides-and-tutorials/optimize-and-measure/configure-analytics/analytics-vendors/#facebook-pixel

    Plugin Author Weston Ruter

    (@westonruter)

    I do not have experience with Google Optimizer, but it is possible to use Google Optimizer on AMP pages. See https://developers.google.com/optimize/devguides/amp-experiments

    You’ll have to adapt any scripts you’re currently using to instead make use of amp-experiment and amp-analytics.

    Thread Starter adil1641

    (@adil1641)

    Hi @westonruter , currently in the amp version, google analytics, google optimizer and Facebook pixel code is removed. All of these are manually added in the <head> tag. They are not coming through plugin.
    You have send me the code to add Facebook pixel code in functions.PHP file.
    add_action( ‘wp_footer’, function() {
    if ( function_exists( ‘is_amp_endpoint’ ) && is_amp_endpoint() ) {
    ?>
    <amp-pixel src=”https://www.facebook.com/tr?id=1929018283986357&ev=PageView&noscript=1&#8243; layout=”nodisplay”></amp-pixel>
    <?php
    }
    } );
    When i will add this one, then non-amp version will disturb or not?

    1) Can you please send me code to add google analytics and google optimizer for amp version?
    2) These codes will also be added in the functions.php as well or not?

    3) Please see this link, “http://creativesystems.0438cfd.netsolhost.com/outdoor-playground-equipment/?amp&#8221;. This is category page in which subcategories are listed when i click on sub category “View All Detail” button, It is not redirecting to amp version and also the products in these subcategories are also not redirecting to amp version.

    While on the other hand, this is the category page in which products are listed
    http://creativesystems.0438cfd.netsolhost.com/combination-series/?amp&#8221;. All of the products in this page are redirecting to amp version. Please tell me about this one also.

    Please tell me about these things so that i will fix them

    • This reply was modified 2 years, 9 months ago by adil1641.
    • This reply was modified 2 years, 9 months ago by adil1641.
    • This reply was modified 2 years, 9 months ago by adil1641.
    Thread Starter adil1641

    (@adil1641)

    hi @westonruter , i have seen this message on my last reply
    “This post has been held for moderation by our automated system and will be manually reviewed by a moderator.”
    Why this message is showing on my post?

    Plugin Author Weston Ruter

    (@westonruter)

    When i will add this one, then non-amp version will disturb or not?

    No, it would not modify the non-AMP version.

    1) Can you please send me code to add google analytics and google optimizer for amp version?

    I am not experienced with Google Optimizer so I cannot advise. I suggest the Google Optimizer support resources: https://support.google.com/optimize/

    2) These codes will also be added in the functions.php as well or not?

    If you’re using hooks like wp_head to add the code, then you can put it in functions.php. Otherwise, if you’ve directly modify the header.php template code already, you can just put the code straight into header.php.

    Plugin Author Weston Ruter

    (@westonruter)

    3) Please see this link, http://creativesystems.0438cfd.netsolhost.com/outdoor-playground-equipment/?amp This is category page in which subcategories are listed when i click on sub category “View All Detail” button, It is not redirecting to amp version and also the products in these subcategories are also not redirecting to amp version.

    The “View All Details” button is not linking to the same site. It is linking off to https://www.creativesystems.com/ so that is why the URL does not have ?amp added to it. It looks like you need to replace the URLs in the DB for your staging site, to replace www.creativesystems.com with creativesystems.0438cfd.netsolhost.com.

    Thread Starter adil1641

    (@adil1641)

    Can you please send the code for google analytics for amp version. If I directly modify the header.php file, then there is also code for non-amp version.
    I think this should raise the conflict. because in this way, both code for amp and non-amp versions will be added in header.php.

    1)This link has now passed the amp test. Please check as well
    https://validator.ampproject.org/#url=http%3A%2F%2Fcreativesystems.0438cfd.netsolhost.com%2Fcategory%2Fcreativesystem-blog%2F%3Famp

    2) Can you please tell where to change the success message after submitting footer newsletter. You can please check by submitting information in footer newsletter.

    I think there should be condition for google analytics code for amp version.

    Please tell me about all these thing?

    • This reply was modified 2 years, 9 months ago by adil1641.
    Plugin Author Weston Ruter

    (@westonruter)

    Can you please send the code for google analytics for amp version.

    No, I cannot. I am not experienced with Google Optimizer so I cannot advise. I suggest the Google Optimizer support resources: https://support.google.com/optimize/

    For Google Analytics in general, I recommend using the Google’s own Site Kit plugin.

    Thread Starter adil1641

    (@adil1641)

    Hi @westonruter , I have two questions
    1)This link has now passed the amp test. Please check as well
    https://validator.ampproject.org/#url=http%3A%2F%2Fcreativesystems.0438cfd.netsolhost.com%2Fcategory%2Fcreativesystem-blog%2F%3Famp

    2) Can you please tell where to change the success message after submitting footer newsletter. You can please check by submitting information in footer newsletter.

    3) https://wordpress.org/plugins/google-site-kit/. This plugin will do work for both amp and non-amp versions.

    Please guide me about this thing.

    • This reply was modified 2 years, 9 months ago by adil1641.
    Plugin Author Weston Ruter

    (@westonruter)

    1)This link has now passed the amp test. Please check as well
    https://validator.ampproject.org/#url=http%3A%2F%2Fcreativesystems.0438cfd.netsolhost.com%2Fcategory%2Fcreativesystem-blog%2F%3Famp

    The site is not loading. It returns with “502 Bad Gateway”.

    2) Can you please tell where to change the success message after submitting footer newsletter. You can please check by submitting information in footer newsletter.

    It depends on how you have implemented the form.

    3) https://wordpress.org/plugins/google-site-kit/. This plugin will do work for both amp and non-amp versions. Please guide me about this thing.

    It is AMP-compatible, yes. If you need support with Site Kit, you can use its plugin support forum.

Viewing 15 replies - 1 through 15 (of 40 total)
  • The topic ‘Is this Website is amp Compatible?’ is closed to new replies.