Title: AMP errors with analytics
Last modified: October 25, 2016

---

# AMP errors with analytics

 *  Resolved [kaeliblomst](https://wordpress.org/support/users/kaeliblomst/)
 * (@kaeliblomst)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/amp-errors-with-analytics/)
 * Hi.
    I’m using Google analytics by Monsterinsights.
 * My search console comes up with the error that there is user-created JavaScript
   on my website, and therefore AMP pages are not shown.
 * When looking into what’s causing the errors, I see that it has something to do
   with the Analytics that creates a script.. How do I fix this?? 🙂
 * I put the 2 codes here:
 * <script>
    (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){(
   i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
   m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,
   m) })(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’);
 *  ga(‘create’, ‘UA-43334056-2’, ‘auto’);
    ga(‘send’, ‘pageview’);
 * </script>
 * <script async type=’text/javascript’ src=’[https://www.konkurrencer-nonstop.dk/wp-content/plugins/cleantalk-spam-protect/inc/cleantalk_nocache.js?random=5.50′></script&gt](https://www.konkurrencer-nonstop.dk/wp-content/plugins/cleantalk-spam-protect/inc/cleantalk_nocache.js?random=5.50′></script&gt);
   
   </body>

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

 *  [Denis Shagy](https://wordpress.org/support/users/shagimuratov/)
 * (@shagimuratov)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/amp-errors-with-analytics/#post-8351817)
 * Hello,
 * Please look the solution to do ‘Spam protection by CleanTalk’ compatible with
   AMP,
    [https://wordpress.org/plugins/cleantalk-spam-protect/faq/](https://wordpress.org/plugins/cleantalk-spam-protect/faq/)
 * >  [https://wordpress.org/plugins/cleantalk-spam-protect/faq/](https://wordpress.org/plugins/cleantalk-spam-protect/faq/)
 * Thanks.
 *  Thread Starter [kaeliblomst](https://wordpress.org/support/users/kaeliblomst/)
 * (@kaeliblomst)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/amp-errors-with-analytics/#post-8351834)
 * Hi.
    Thanks 🙂 How about the first error with analytics? Is that also related
   to the Cleantalk?
    -  This reply was modified 9 years, 7 months ago by [kaeliblomst](https://wordpress.org/support/users/kaeliblomst/).
 *  [Denis Shagy](https://wordpress.org/support/users/shagimuratov/)
 * (@shagimuratov)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/amp-errors-with-analytics/#post-8351839)
 * [@kaeliblomst](https://wordpress.org/support/users/kaeliblomst/) no, it isn’t.
 * You are welcome.
 *  Thread Starter [kaeliblomst](https://wordpress.org/support/users/kaeliblomst/)
 * (@kaeliblomst)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/amp-errors-with-analytics/#post-8351851)
 * Ok.. Thanks 🙂
 * 1 down – 1 to go 🙂
 * Anyone who knows how I get rid of the 1 st. error:
 * <script>
    (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){(
   i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
   m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,
   m) })(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’);
 * ga(‘create’, ‘UA-43334056-2’, ‘auto’);
    ga(‘send’, ‘pageview’);
 * </script>
 *  Plugin Author [chriscct7](https://wordpress.org/support/users/chriscct7/)
 * (@chriscct7)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/amp-errors-with-analytics/#post-8355500)
 * Hi there,
    That analytics code isn’t coming from MonsterInsights as we prefix
   all of our ga variables and use another parameter in the asynchronous load script.
 * My guess is maybe is coming from your theme, but it’s definately not coming from
   MonsterInsights.
 * -Chris
    -  This reply was modified 9 years, 7 months ago by [chriscct7](https://wordpress.org/support/users/chriscct7/).

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

The topic ‘AMP errors with analytics’ is closed to new replies.

 * ![](https://ps.w.org/google-analytics-for-wordpress/assets/icon.svg?rev=2976619)
 * [MonsterInsights - Google Analytics Dashboard for WordPress (Website Stats Made Easy)](https://wordpress.org/plugins/google-analytics-for-wordpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-analytics-for-wordpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-analytics-for-wordpress/)
 * [Active Topics](https://wordpress.org/support/plugin/google-analytics-for-wordpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-analytics-for-wordpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-analytics-for-wordpress/reviews/)

## Tags

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

 * 5 replies
 * 3 participants
 * Last reply from: [chriscct7](https://wordpress.org/support/users/chriscct7/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/amp-errors-with-analytics/#post-8355500)
 * Status: resolved