# nextjs13_google_adsense

> Google Adsense package for working into the nextjs 13 and above.

Latest version **1.0.9** (published 2025-03-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install nextjs13_google_adsense
pnpm add nextjs13_google_adsense
yarn add nextjs13_google_adsense
bun add nextjs13_google_adsense
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2025-03-31 |
| First published | 2023-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.1 KB |
| Known vulnerabilities | 0 (+34 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Shrikant Dhayaje |
| Maintainers | shriekdj |
| Keywords | nextjs, nextjs13, google adsense, react, nextjs 13 google adsense, shriekdj |

## Links

- npm: https://www.npmjs.com/package/nextjs13_google_adsense
- Repository: https://github.com/shriekdj/nextjs13_google_adsense
- Homepage: https://github.com/shriekdj/nextjs13_google_adsense#readme
- Issues: https://github.com/shriekdj/nextjs13_google_adsense/issues
- npm.io page: https://npm.io/package/nextjs13_google_adsense

## Dependencies (1)

- [next](https://npm.io/package/next.md) ^13.5.6

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.9 (latest) — 2025-03-31
- 1.0.8 — 2024-01-02
- 1.0.6 — 2023-10-04
- 1.0.5 — 2023-10-04
- 1.0.3 — 2023-10-04
- 1.0.2 — 2023-09-28
- 1.0.1 — 2023-09-28
- 1.0.0 — 2023-08-19

## README

# nextjs13_google_adsense

This Package Helps reload ad on Every Page change in the nextjs 13 application and above.

Before using this package add this code in `head` of your root layout file.

```jsx
<Script
  async
  src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1234567890123456"
  crossOrigin="anonymous"
  strategy="lazyOnload"
/>
```

From Google You May Get this type code for ad unit which should be changed.

```html
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1234567890123456" crossorigin="anonymous"></script>
<!-- Homepage Leaderboard -->
<ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-1234567890123456" data-ad-slot="1234567890"></ins>
<script>
(window.adsbygoogle = window.adsbygoogle || []).push({});
</script>
```

It should be changed to like this in your page

```jsx
import GoogleAdUnit from 'nextjs13_google_adsense'

export default function MyPage() {
  return <>
  <div>Test Title</div>
  <GoogleAdUnit>
    <ins
          className="adsbygoogle"
          style={{ display: 'block', width: '100%' }}
          data-ad-client="ca-pub-1234567890"
          data-ad-slot="123456"
          data-ad-format="auto"
          data-full-width-responsive="true"
        ></ins>
  </GoogleAdUnit>
  <div>Test Content</div>
  <>;
}
```

**If any errors occured then errors will be displayed on client or your browser's console.**

---
_Source: https://npm.io/package/nextjs13_google_adsense · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
