Title: Adsense Auto ads &#8220;java script not allowed&#8221;
Last modified: October 17, 2019

---

# Adsense Auto ads “java script not allowed”

 *  Resolved [Ioanna Iliadi](https://wordpress.org/support/users/ioanna/)
 * (@ioanna)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/adsense-auto-ads-java-script-not-allowed/)
 * I got a suggestion from google adsense to use auto ads in my website. For the
   amp pages I have to add this code to the head” section
 * <script data-ad-client=”ca-pub-***************” async src=”[https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script&gt](https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script&gt);
   
   After adding I got the “java script not allowed” error
 * and in google search console the message “Linked AMP version is invalid” Issues
   
   Custom JavaScript is not allowed.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fadsense-auto-ads-java-script-not-allowed%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [Ioanna Iliadi](https://wordpress.org/support/users/ioanna/)
 * (@ioanna)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/adsense-auto-ads-java-script-not-allowed/#post-12037489)
 * For more information please check here [https://pastebin.com/husb408Y](https://pastebin.com/husb408Y)
 *  Thread Starter [Ioanna Iliadi](https://wordpress.org/support/users/ioanna/)
 * (@ioanna)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/adsense-auto-ads-java-script-not-allowed/#post-12037553)
 * I followed google instructions [https://support.google.com/adsense/answer/9011465?hl=en&ref_topic=9011386](https://support.google.com/adsense/answer/9011465?hl=en&ref_topic=9011386)
 *  Plugin Author [Ahmed Kaludi](https://wordpress.org/support/users/ahmedkaludi/)
 * (@ahmedkaludi)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/adsense-auto-ads-java-script-not-allowed/#post-12045542)
 * You can easily integrate Auto ads easily, like: [https://ampforwp.com/tutorials/article/how-to-set-auto-ads-in-amp/](https://ampforwp.com/tutorials/article/how-to-set-auto-ads-in-amp/)
 * That would help you implement it easily.
 *  [macnux](https://wordpress.org/support/users/macnux/)
 * (@macnux)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/adsense-auto-ads-java-script-not-allowed/#post-12429782)
 * Hi [@ahmedkaludi](https://wordpress.org/support/users/ahmedkaludi/)
    This code
   what Google gave me to enter `<script data-ad-client="ca-pub-1234567890123456"
   async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></
   script>` I insert this code using AMPforWP plugin on advanced settings on the
   head section and it shows this error `Custom JavaScript is not allowed.`
 *  Plugin Author [Ahmed Kaludi](https://wordpress.org/support/users/ahmedkaludi/)
 * (@ahmedkaludi)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/adsense-auto-ads-java-script-not-allowed/#post-12429855)
 * macnux: As per the forum guidelines you have to be created a new topic.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Adsense Auto ads “java script not allowed”’ is closed to new replies.

 * ![](https://ps.w.org/accelerated-mobile-pages/assets/icon-256x256.png?rev=1693616)
 * [AMP for WP - Accelerated Mobile Pages](https://wordpress.org/plugins/accelerated-mobile-pages/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/accelerated-mobile-pages/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/accelerated-mobile-pages/)
 * [Active Topics](https://wordpress.org/support/plugin/accelerated-mobile-pages/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/accelerated-mobile-pages/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/accelerated-mobile-pages/reviews/)

## Tags

 * [amp error](https://wordpress.org/support/topic-tag/amp-error/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 5 replies
 * 3 participants
 * Last reply from: [Ahmed Kaludi](https://wordpress.org/support/users/ahmedkaludi/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/adsense-auto-ads-java-script-not-allowed/#post-12429855)
 * Status: resolved