Skip to content

hustcc/react-adsense

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-adsense

react-adsense is a React-component for Google AdSense / Baidu advertisement.

Build Status npm npm npm demo

1. Install

npm install --save react-adsense

Before use Google AdSense, you should add the script at the end of HTML.

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

2. Usage

import React from 'react'; import AdSense from 'react-adsense'; <AdSense.Google client='ca-pub-7292810486004926' slot='7806394673' /> // or <AdSense.Google client='ca-pub-7292810486004926' slot='7806394673' style={{width: 500, height: 300, float: 'left'}} format='' />

3. TODO

  • Baidu advertisement supported.
  • Google sync adsense supported.

4. LICENSE

MIT

About

📽️ a simple React-component for Google AdSense / Baidu advertisement.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7