Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub


Add Google Adsense Tag to your Gatsby site.

npm (scoped) npm


Install the plugin:

npm install @w2-yamaguchi/gatsby-plugin-google-adsense


yarn add @w2-yamaguchi/gatsby-plugin-google-adsense

Add it to your gatsby-config.js & configure Your publisher ID(required):

// In your gatsby-config.js
module.exports = {
  plugins: [
      resolve: `@w2-yamaguchi/gatsby-plugin-google-adsense`,
      options: {
        publisherId: "YOUR_GOOGLE_ADSENSE_PUBLISHER_ID", // Required


The options are as follows:

Property Type Default Description
publisherId String n/a (required) Your publisher ID. This looks like this: pub-1234567891234567. See here for more information.
© 2023 Gatsby, Inc.