• Resolved juma33

    (@juma33)


    Hi! Google Search Console shows me about 50 AMP pages on my site have this error: The tag ‘amp-auto-ads extension .js script’ appears more than once in the document.

    An example is this AMP url: AMP url

    I’m using the official AMP plugin and used the Head, Footer and Post Injections plugin to add the amp-auto-ads script (It has a specific section for AMP scripts).

    I used the Head, Footer and Post Injections plugin because the Advanced Ads plugin requires a paid add-on to add the amp-auto-ads script.

    Would appreciate your help. Thanks.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • @juma33 Can you attempt removing any of the amp-auto-ads scripts from the “Head, Footer and Post Injections” plugin and add the following to your active themes functions.php file?

    add_filter('amp_post_template_data', function($data){
    	$data['amp_component_scripts'] = array_merge(
    		$data['amp_component_scripts'],
    		array(
    			'amp-auto-ads' => true,
    		)
    	);
    
    	return $data;
    });

    That will ensure the resource is called once. You can also use Site Kit to implement Auto ads for AMP on your site.

    Thread Starter juma33

    (@juma33)

    Thank you @jamesosborne. I’ve received an email saying Google Search Console has started validating the fix (says it will take a few days). I’ve also used Site Kit to implement auto ads for AMP. Thanks!

    @juma33 Good to hear, thanks for the update. If you find the plugin useful be sure to leave a review.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Tag ‘amp-auto-ads extension .js script’ appears more than once’ is closed to new replies.