How to properly embed this script on the page?

Hi Guys,

Do you have any idea how can I embed this scripts on the page? Please help.

Thanks

 <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:block"
     data-ad-format="autorelaxed"
     data-ad-client="ca-pub-72274267066234343"
     data-ad-slot="85298534343"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>

My preferred method of adding external scripts is using Google Tag Manager and the GTM package for Frontity.

Alternatively you can check out the Google Ad Manager package for Frontity which is build around ads.

Hi @Johan ,

Thank you for your reply. I believe Google Ad Manager is different from Google Adsense. Right now, I’m just using Google Adsense. Could you please help me how can I make it work on my site?

Thanks

Yes they are different, but GAM also handles the same ads as AdSense.

But in that case simply use Google Tag Manager, which will allow you to embed any scripts (ads, analytics, etc.) all from a single tool. And it requires no configuration other than setting your ID in the configs.

Google has amazing documentation on how GTM works, and the packi I linked before also explains very well how to implement it.

However I have no idea how to handle ad placement with AdSense in React, but I’m sure there are React packages for that.