• Hi, I placed some Adsense ads on the bottom of the AMP page. Now I get the following message:
    The tag ‘amp-ad extension .js script’ is missing or incorrect, but required by ‘amp-ad’. This will soon be an error.
    How can I add the required script to the AMP Plugin?
    <script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>

Viewing 3 replies - 1 through 3 (of 3 total)
  • Something like this should work:

    
    add_action( 'amp_post_template_data', 'loano1_add_amp_ad_script' );
    function loano1_add_amp_ad_script( $data ) {
    	if ( ! isset( $data['amp_component_scripts']['amp-ad'] ) ) {
    		$data['amp_component_scripts']['amp-ad'] = 'https://cdn.ampproject.org/v0/amp-ad-0.1.js';
    	}
    	return $data;
    }
    

    @loano1 You can use this toolbox plugin with AMP for better AD integration support https://www.ads-software.com/plugins/accelerated-mobile-pages/

    Regards,

    Thread Starter David

    (@loano1)

    Thanks for the answers!

    @mohammad, sorry but I’m not sure where to place this code exactly within the plugin. Could you please describe it a bit more in detail? Thanks!

    @ahmed, I tried to install your plugin, but I get an error (Something like:
    Installation failed: Not able to copy the file. accelerated-mobile-pages/includes/options/redux-framework/inc/extensions/options_object/options_object/field_options_object.min.js) and from the description I miss a way to select different kind of stylings. Maybe I will give it a try in the future…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘New ad requirements’ is closed to new replies.