Is this Website is amp Compatible?
-
Hi, I have two questions.
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.
https://creativesystems.0438cfd.netsolhost.com/category/creativesystem-blog/?amp
2) If user comes from organic search in mobile, then he will find this website with amp link or not?
3) Can I make this website home page in amp or not?
Please tell me about all these questions?
-
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.
https://creativesystems.0438cfd.netsolhost.com/category/creativesystem-blog/?ampThe 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: https://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.
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 5 years ago by adil1641.
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%3FampHi @westonruter , I have one more question. Is Amp works only on SSL or not?
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.
https://creativesystems.0438cfd.netsolhost.com/?amp
https://creativesystems.0438cfd.netsolhost.com/Please guide me about this one
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-pixelI 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
andamp-analytics
.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″ 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, “https://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.
While on the other hand, this is the category page in which products are listed
“https://creativesystems.0438cfd.netsolhost.com/combination-series/?amp”. 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
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?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 infunctions.php
. Otherwise, if you’ve directly modify theheader.php
template code already, you can just put the code straight intoheader.php
.3) Please see this link, https://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 replacewww.creativesystems.com
withcreativesystems.0438cfd.netsolhost.com
.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%3Famp2) 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 5 years ago by adil1641.
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.
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%3Famp2) 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://www.ads-software.com/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 5 years ago by adil1641.
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%3FampThe 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://www.ads-software.com/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.
- The topic ‘Is this Website is amp Compatible?’ is closed to new replies.