Webtiryaki Bulut Themes!

The simplest and fastest way to build great UI for your community.

How to Add AdSense in Astro JS Sites?

  • Thread starter Thread starter Team Sloth
  • Start date Start date
T

Team Sloth

Guest
I recently made a website using astro js. Now, I am trying to add adsense ads in my site. The anchor ads and vignette ads are working fine, but display ads are not showing up. How to diaply the display ads on the position we want, for example, if i want to show the display adsense below the navigation menu, but it is not showing up.

Please help if anybody can help?

I put adsense ads in component and then imported that component in index.astro file, but it's not working.

Code:
<div id="page">
  <h1>Title</h1>
<script  is:inline
          async
          src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-XXXXXXXXXXXXXX"
          crossorigin="anonymous"
        ></script>
        <!-- Ads -->
        <ins
          class="adsbygoogle block w-full"
          style="display:block"
          data-ad-client="ca-pub-XXXXXXXXXXXXXX""
          data-ad-slot="XXXXXXXXXXXXXX""
          data-ad-format="auto"
          data-full-width-responsive="true"></ins>
        <script  is:inline src="../lib/ads.js"></script>

  <div class="main-content flex justify-center items-start mt-4">
<p>I recently made a website using astro js. Now, I am trying to add adsense ads in my site. The anchor ads and vignette ads are working fine, but display ads are not showing up. How to diaply the display ads on the position we want, for example, if i want to show the display adsense below the navigation menu, but it is not showing up.</p>
<p>Please help if anybody can help?</p>
<p>I put adsense ads in component and then imported that component in index.astro file, but it's not working.</p>
<pre><code><div id="page">
<h1>Title</h1>
<script is:inline
async
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-XXXXXXXXXXXXXX"
crossorigin="anonymous"
></script>
<!-- Ads -->
<ins
class="adsbygoogle block w-full"
style="display:block"
data-ad-client="ca-pub-XXXXXXXXXXXXXX""
data-ad-slot="XXXXXXXXXXXXXX""
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script is:inline src="../lib/ads.js"></script>

<div class="main-content flex justify-center items-start mt-4">
</code></pre>
Continue reading...
 
Top