{"id":20924438,"url":"https://github.com/techmely/nuxt-google-adsense","last_synced_at":"2026-02-05T00:37:28.174Z","repository":{"id":261644042,"uuid":"884918890","full_name":"techmely/nuxt-google-adsense","owner":"techmely","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-07T16:50:39.000Z","size":193,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-24T19:58:40.734Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/techmely.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-07T16:11:32.000Z","updated_at":"2024-11-07T16:50:42.000Z","dependencies_parsed_at":"2024-11-07T17:46:28.294Z","dependency_job_id":null,"html_url":"https://github.com/techmely/nuxt-google-adsense","commit_stats":null,"previous_names":["techmely/nuxt-google-adsense"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/techmely/nuxt-google-adsense","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techmely%2Fnuxt-google-adsense","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techmely%2Fnuxt-google-adsense/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techmely%2Fnuxt-google-adsense/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techmely%2Fnuxt-google-adsense/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techmely","download_url":"https://codeload.github.com/techmely/nuxt-google-adsense/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techmely%2Fnuxt-google-adsense/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29103422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T22:44:52.815Z","status":"ssl_error","status_checked_at":"2026-02-04T22:44:16.428Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T20:22:09.748Z","updated_at":"2026-02-05T00:37:28.133Z","avatar_url":"https://github.com/techmely.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![License][license-src]][license-href]\n[![Nuxt][nuxt-src]][nuxt-href]\n\n---\n\n**Note:** This branch is for **Nuxt 3** compatible module.\n\n---\n\n\n# Google AdSense\n\u003e Google AdSense integration for Nuxt.js. Advertisements will update whenever the page route changes\n\n## Setup\n- Add `nuxt-google-adsense` dependency using yarn or npm to your project\n- Add `nuxt-google-adsense` to `modules` section of `nuxt.config.js`\n\n```js\n{\n  modules: [\n    // Simple usage\n    ['nuxt-google-adsense', {\n      id: 'ca-pub-###########'\n    }]\n ]\n}\n```\n\nUsing top level options:\n\n```js\n{\n  modules: [\n    ['nuxt-google-adsense']\n  ],\n\n googleAdsense: {\n    id: 'ca-pub-#########'\n  }\n}\n\n```\nUsing runtime config:\n\n```js\n{\n  modules: [\n    ['nuxt-google-adsense']\n  ],\n\n  googleAdsense: {\n    onPageLoad: false,\n    pageLevelAds: false,\n  },\n\n  publicRuntimeConfig: {\n    googleAdsense: {\n      id: process.env.GOOGLE_ADSENSE_ID,\n      test: process.env.GOOGLE_ADSENSE_TEST_MODE === 'true',\n    },\n  },\n}\n```\n\nThe asynchronous ad code (`//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js`) is automatically\nadded to the `\u003chead\u003e` section of your pages.\n\n\n## Configuration options\n\n| Option | type |  description\n| -------- | ---- | -----------\n| `id` | String | Your Google AdSense Publisher client ID (i.e. `ca-pub-#########`). **Required** when not in test mode.\n| `adFormat` | String | Sets a global default ad format. Can be overridden with component props.\n| `analyticsDomainName` | String | Google Analytics Account Domain (if linking analytics with AdSense, i.e. `example.com`).\n| `analyticsUacct` | String | Google Analytics Account ID (if linking analytics with AdSense, i.e. `UA-#######-#`).\n| `hideFilled` | Boolean | When `false`, unfilled ads will not be hidden, when `true` unfilled ads will be hidden. The default is `false`. \n| `includeQuery` | Boolean | When `false`, only `$route.path` is checked for changes. If set to `true` `$route.query` will also be taken into account. The default is `false`.\n| `onPageLoad` | Boolean | Loads Adsense script after page load. Default is `false`.\n| `overlayBottom` | Boolean | Enable Adsense Anchor Ads to show at bottom. Default is `false`. Refer to the AdSense docs for details.\n| `pageLevelAds` | Boolean | Enable AdSense Page Level Ads. Default is `false`. Refer to the AdSense docs for details.\n| `pauseOnLoad` | Boolean | Pauses ad requests to obtain user consent to use cookies or other local storage in accordance with the GDPR. Refer to the AdSense docs for details. `false`.\n| `tag` | String | AdSense component tag name. Defaults to `adsbygoogle`.\n| `test` | Boolean | Force AdSense into _test_ mode (see below).\n\n### Test mode\n\nThe AdSense module will automatically switch to `test` mode when running Nuxt in `dev` mode.\nBut you can keep test mode on in production by setting the configuration option `test` to `true`.\n\nTest mode uses a test publisher ID, so that you will not be violating AdSense TOS.\n\nNote that test advertisements will typically appear as an empty space, but will have the\ncorrect dimensions (i.e. will occupy the correct space needed by the rendered ad).\n\n## Usage\n\nInsert the `\u003cAdsbygoogle /\u003e` component wherever you would like an advertisement placed.\n\nYou should place the `\u003cAdsbygoogle /\u003e` component inside a container element\nthat has a specified (min/max) width and (min/max) height (which can be based on media queries),\nor use style or classes on the `\u003cAdsbygoogle /\u003e` component to restrict the advertisement to a\nspecific size (or sizes).\n\nUse the `ad-slot` property to specify your Google AdSense ad slot value (specified as a string).\n\nPlease refer to the adsense documentation for more info.\n[Google Adsense Documentation](https://support.google.com/adsense/answer/9183549?hl=en\u0026ref_topic=9183242\u0026sjid=7647008134090136391-NA)\n\n**Component props:**\n\n| prop | type | description\n| ---- | ---- | -----------\n| `ad-slot` | String | Google Adsense adslot. **This prop is required when not in test mode**. Refer to your AdSense account for ad-slot values.\n| `ad-format` | String | Optional. Refer to the AdSense docs for other options\n| `ad-style` | Object | Styles to apply to the rendered `\u003cins\u003e` element. Default: `{ display: 'block' }`. Refer to VueJS [style binding docs](https://vuejs.org/v2/guide/class-and-style.html#Object-Syntax-1) for the Object format.\n| `ad-layout` | String | Optional. Refer to the AdSense docs\n| `ad-layout-key` | String | Optional. Refer to the AdSense docs\n| `hide-unfilled` | Boolean | Optional. Hides unfilled ads if true.\n| `page-url` | String | Optional.  Set a reference page URL (of similar content) if the ad is on a page that requires authentication. When set, this prop must be a fully qualified URL (including protocol and hostname).\n| `include-query` | Boolean | Override global option `includeQuery` on a per ad basis. Ensure all ads on a page have the same setting.\n| `analytics-uacct` | String | Google Analytics Account ID (if linking analytics with AdSense, i.e. `UA-#######-#`). Defaults to the value specified in the plugin option `analyticsUacct`.\n| `analytics-domain-name` | String | Google Analytics Account domain (if linking analytics with AdSense, i.e. `example.com`). Defaults to the value specified in the plugin option `analyticsDomainName`.\n\n**Component exposed internal data**\n| name | type | description\n| ____ | ____ | ___________\n|`showAd` | method | Trigger the show ad method to show the ad.\n| `updateAd` | method | Trigger the update ad method to refresh the ad.\n| `isUnfilled` | computed ref | Tracks unfilled attribute on ad element. Returns `true` if `data-ad-state` = 'unfilled'.\n\n## Automatic updating of Ads\nWhenever your route changes or optionally if your route query parameters change, any displayed ads will update, just as they would on normal\npage loads.\n\n\n## Caveats:\n- **Caution:** Reloading of ads arbitrarily (with minimal page content changes) may result in\nthe suspension of your AdSense account. _Refer to AdSense for full terms of use._\n- Google needs to crawl each page where ads appear. Ensure your site SSR renders any page where\nads appear. Ads on un-crawlable pages will not be shown.\n- When placing ads on pages that require authentication, set `page-url` on the `\u003cAdsbygoogle /\u003e` component to the URL of a page on your site that is publicly accessible, which would have similar/relevant content.\n\n\n## Background\nThis module uses a technique developed by the Angular team (with help from Google AdSense)\nto handle updating ads on progressive web applications:\n- https://github.com/leonardteo/google-ads-test-angularjs\n- https://groups.google.com/forum/#!topic/angular/eyVo4XU04uk\n\nEach time a new advertisement is requested, the AdSense parameter `data-ad-region` is\nupdated to a random value. For this reason, you cannot set the `data-ad-region` attribute\non the `\u003cAdsbygoogle /\u003e` component.\n\n\n## License\n\n[MIT License](./LICENSE)\n\n\n\u003c!-- Badges --\u003e\n[npm-version-src]: https://img.shields.io/npm/v/nuxt-google-adsense/latest.svg?style=flat\u0026colorA=18181B\u0026colorB=28CF8D\n[npm-version-href]: https://npmjs.com/package/nuxt-google-adsense\n\n[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-google-adsense.svg?style=flat\u0026colorA=18181B\u0026colorB=28CF8D\n[npm-downloads-href]: https://npmjs.com/package/@nuxtjs/google-adsene\n\n[license-src]: https://img.shields.io/npm/l/nuxt-google-adsense.svg?style=flat\u0026colorA=18181B\u0026colorB=28CF8D\n[license-href]: https://npmjs.com/package/nuxt-google-adsense\n\n[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js\n[nuxt-href]: https://nuxt.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechmely%2Fnuxt-google-adsense","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechmely%2Fnuxt-google-adsense","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechmely%2Fnuxt-google-adsense/lists"}