Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-google-ad

lukehansell423ISC1.0.2

A React component to display a Google Adsense advert.

Google, Advert, AdSense, React, Component, react-component

readme

Google Ad React Component

Installation

npm i --save react-google-ad

Then in your HTML include:

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

Usage

import GoogleAd from 'react-google-ad'
<GoogleAd client="xxx" slot="xxx" format="xxx" />

Arguments

  • client: the data-ad-client provided by Google
  • slot: the data-ad-slot provided by Google
  • format: the data-ad-format provided by Google