blog/gatsbyjs-add-google-adsense/ #1616
Replies: 6 comments
-
Great explanation, but why we don not see any ads on your site ? it seems that the code above is not working! |
Beta Was this translation helpful? Give feedback.
-
@aissa-bouguern On my website, there will be no ads on the home page which I restricted on the AdSense portal. But there will be ads on blog posts for those who are not using any kind of adblocker. And it's up to Adsense decision to show ads or not. Attached the screenshot of the Adsense report for this week. |
Beta Was this translation helpful? Give feedback.
-
When i use firefox browser the console shows this warning. |
Beta Was this translation helpful? Give feedback.
-
@Gilbishkosma The warning in Firefox browser is because of its privacy features which are explained here. |
Beta Was this translation helpful? Give feedback.
-
Hi! I've been trying to put ads on my gatsby website for a while and it seems impossible. Adsense is asking me to put this code <script data-ad-client="ca-pub-xxxxxxxxxxx" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> on the head of the html, the problem is gatsby adds this data-checked-head="true" to the script and this way adsense doesn't recognize the code. I've tried different plugins and doing what you say here but it doesn't work I guess this is only for those who already have been verified by adsense |
Beta Was this translation helpful? Give feedback.
-
@gisellesantin if you are hosting your site on Netlify, they have a feature called Snippet injection, located under <script async="" type="text/javascript" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-xxxxxxx",
enable_page_level_ads: true
});
</script> And ads visibility mainly depends on your adsense account settings and your content. Try as mentioned in this article and give it a bit of time and check in different browsers to see if ads are getting displayed. For me it worked fine, but now my adsense account address verification is pending hence no ads (see above comment). |
Beta Was this translation helpful? Give feedback.
-
GatsbyJS - Add Google AdSense | Abhith Rajan
Make use of GatsbyJS SSR APIs to integrate Google Adsense
https://www.abhith.net/blog/gatsbyjs-add-google-adsense/
Beta Was this translation helpful? Give feedback.
All reactions