See what's launched

The next gen Gatsby is here Performance, developer velocity, and scaling to meet Enterprise needs - See what’s launched

Sign Up for Free
Community Plugin
View plugin on GitHub


Add Google Adsense to your Gatsby site.

npm (scoped) npm


npm install @isamrish/gatsby-plugin-google-adsense


yarn add @isamrish/gatsby-plugin-google-adsense

Usage in Gatsby website

// In your gatsby-config.js
module.exports = {
  plugins: [
      resolve: `@isamrish/gatsby-plugin-google-adsense`,
      options: {
        googleAdClientId: "YOUR_GOOGLE_ADSENSE_TRACKING_ID",
        head: false // Optional



Here you place your Google Adsense tracking id.

Here you can define where to place the tracking script. With head:true it will placed in the header, with head:false it will placed in the body. Default is false.

Google adsense recommends to put script in head tag.

© 2022 Gatsby, Inc.