E
E
Eugene Simon2019-09-19 17:03:29
JavaScript
Eugene Simon, 2019-09-19 17:03:29

Why doesn't the Adsense code pasted through jQuery work?

Hi dear experts!

I insert 2 ad blocks at the end of the file in this way, but the ad does not work:

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
   <script type="text/javascript">
   $(document).ready(function() {
  var ads = $("#adsense").html();

        /* блок 1*/

  $('.grid-barb .product-grid:nth-child(3)').after('<div class="product-layout product-grid add_grid"><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-000000" data-ad-slot="000000" data-ad-format="auto" data-full-width-responsive="true"></ins></div>')

         /* блок 2 */

  $('.grid-barb .product-grid:nth-child(15)').after('<div class="product-layout product-grid add_grid"><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-000000" data-ad-slot="000000" data-ad-format="auto" data-full-width-responsive="true"></ins></div>')

  (adsbygoogle = window.adsbygoogle || []).push({});

  });
</script>


Could you suggest what could be the problem? Everything seems to be correct, the code is inserted, but ads did not start showing in a day

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2019-09-22
@dimonchik2013

insert neoadsense and you will see what works
well, what does debugging say?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question