error plugin a CMP
-
Hello, I can’t get my plugins or the cookie consent manager to work on my website when I activate your AMP plugin
Vídeo: https://youtu.be/zhyEpVfVoNU
The page I need help with: [log in to see the link]
-
Hello @jotapov
Thank you for the support topic, You seem to be using the cookie consent plugin that is not AMP Compatible.
The validation error on your site indicates that the cookie consent plugin uses custom javascript, which is not allowed on AMP, so the AMP WordPress plugin is removing those validation errors ( also custom javascript added by other plugins or themes)
I will recommend contacting the author of the cookie consent plugin to get those validation errors fixed.
Alternatively, we will recommend using GDPR Cookie Compliance along with AMP Enhancer plugin.
Hope this helps!
Ok, but besides the cookie consent manager, the rest of the plugins on my website do not work in the amp version either.
Insert Headers and Footers, Advanced Ads, etc
picture: https://ibb.co/yynX9pj
ad inserter, etc
my google ads are not showing
Hello @jotapov
1) Insert Headers and Footers: If you are using this plugin to add some custom javascript or invalid content ( invalid in terms of AMP)
If you are able to share the code you added using pastebin or gist
We will be happy to suggest you some changes.
eg: you can use the amp_is_request() function in add condition to load content on AMP or only on non-AMP page.
if ( function_exists( 'amp_is_request' ) && amp_is_request() ) { // do something only on AMP pages } if ( function_exists( 'amp_is_request' ) && ! amp_is_request() ) { // do something only on non-AMP pages }
2) Advanced Ads is AMP Compatible, the validation errors might be because of other plugins adding (enqueues) custom scripts like jquery.
I am able to see auto-ads on your site’s AMP page, you may need to insert AMP ads manually for ad units you can check our blog post to learn more about it
Hope this helps!
Hello, the link to your blog is wrong, it is a form.
1- https://pastebin.com/FdA5ysy0
2- The blocks are inserted with advanced ads, but your AMP plugin does not make it work (you can see the normal version of the web to check)
Hello @jotapov
I am not sure why it opened up form for you here is the link https://amp-wp.org/amp-and-ads-on-wordpress/
Please use this script from https://pastebin.com/pfTJdCAQ add it to your active themes functions.php
I am not sure if you have the responsive add-on for Advanced Ads, it converts AdSense ads (ad units) automatically to AMP format.
https://wpadvancedads.com/add-ons/responsive-ads/
alternatively, try and use the https://github.com/milindmore22/amp-ad-compat plugin.
Hello, your link takes me to a form (picture: https://ibb.co/xJKB82z )
I don’t have the advanced ads plugin, will try with your alternativethe paste bin code broke my site and had errors. (picture https://ibb.co/s5q6vx1 )
the plugin alternative didn’t work either.
Please note that I am not a programmer, I am a normal user. As all this is difficult for me, tell me which free ad plugin is compatible with your amp plugin and I test it.
Thanks.Hello @jotapov
Thank you for getting back, I will try to simplify the process for you.
The code Snippet I provided should be added into themes functions.php file and not in Header and Footer plugin as I mentioned in my previous reply.
First let’s add the code snippet in you themes functions.php
Step 1: Login to WordPress as Admin
Step 2 : Goto Apparance-> Theme Editor
Step 3 : click on functions.php file
Step 4 : Scroll Down on functions.php file editor
Step 5 : Copy code from this link https://pastebin.com/pfTJdCAQ
Step 6 : Paste the code in functions.php
You can watch screen recording for same here : https://recordit.co/Szpe18OEa9
Once file is saved sucessfully, you can remove old code from Headers and Footers plugin, screen recording to remove old code : https://recordit.co/WsnUiSfxbE
If you are unable to get Advanced Ads working, I wll recommend trying Ad Inserter plugin.
You can also use Site Kit by Google plugin it inserts auto ads which work on both AMP and non-AMP pages.
Hope this helps!
Hi, Thanks for the videos. I did it but the ads are not showing, I will try other alternatives. Thanks.
Hi, i have managed to show the ads with ad inserter, but now my consent manager does not work.
would you be so kind as to mount the code tell me don to put it?
Picture: https://ibb.co/DptMnRm
head:
<script async custom-element = “amp-consent” src = “https://cdn.ampproject.org/v0/amp-consent-0.1.js”> </script>`body:
<amp-consent layout="nodisplay" id="consent-element"> <script type="application/json"> { "consentInstanceId": "clickio", "consentRequired": "remote", "checkConsentHref": "https://clickio.mgr.consensu.org/check/?s=222077&cid=CLIENT_ID&pid=PAGE_VIEW_ID_64", "promptUISrc": "https://clickio.mgr.consensu.org/prompt/?s=222077&cid=CLIENT_ID&pid=PAGE_VIEW_ID_64", "onUpdateHref": "https://clickio.mgr.consensu.org/update/?s=222077&cid=CLIENT_ID&pid=PAGE_VIEW_ID_64", "postPromptUI": "post-consent-ui", "uiConfig":{ "overlay": true } } </script> </amp-consent> <div class="consent-cls-wrapper" style="min-height: 30px; margin: 10px 0;"> <div style="margin: 0; text-align: center;" id="post-consent-ui"> <button on="tap:consent-element.prompt" style="border: none; background: none; text-decoration: underline; padding: 0;">Change privacy settings</button> </div> </div>
head:
<amp-consent layout="nodisplay" id="consent-element"> <script type="application/json"> { "consentInstanceId": "clickio", "consentRequired": "remote", "checkConsentHref": "https://clickio.mgr.consensu.org/check/?s=222077&cid=CLIENT_ID&pid=PAGE_VIEW_ID_64", "promptUISrc": "https://clickio.mgr.consensu.org/prompt/?s=222077&cid=CLIENT_ID&pid=PAGE_VIEW_ID_64", "onUpdateHref": "https://clickio.mgr.consensu.org/update/?s=222077&cid=CLIENT_ID&pid=PAGE_VIEW_ID_64", "postPromptUI": "post-consent-ui", "uiConfig":{ "overlay": true } } </script> </amp-consent> <div class="consent-cls-wrapper" style="min-height: 30px; margin: 10px 0;"> <div style="margin: 0; text-align: center;" id="post-consent-ui"> <button on="tap:consent-element.prompt" style="border: none; background: none; text-decoration: underline; padding: 0;">Change privacy settings</button> </div> </div>
Hello @jotapov
Please follow my previous method of adding code to functions.php and add code from this link https://pastebin.com/CpPD8sLe
Also, You are required to edit Ad code to add an attribute
data-block-on-consent
to the <amp-ad> component.example:
<amp-sticky-ad layout="nodisplay" data-block-on-consent> <amp-ad width="320" height="50" type="adsense" data-ad-client="ca-pub-xxxxxxxxxxxxxxxxxx" data-slot="xxxxxxxx"> </amp-ad> </amp-sticky-ad>
<amp-ad data-block-on-consent width="320" height="50" type="adsense" data-ad-client="ca-pub-xxxxxxxxxxxxxxxxxx" data-slot="xxxxxxxx"> </amp-ad>
Forgot to mention that you don’t need to add the script
<script async custom-element = “amp-consent” src = “https://cdn.ampproject.org/v0/amp-consent-0.1.js”> </script>
as AMP plugin will add them when it finds amp components being used on the AMP page.
- The topic ‘error plugin a CMP’ is closed to new replies.