Skip to content

veeracs/react-gpt-ad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A lazily instantiated React component for Google Publisher Tags.

Th React Component asynchronously loads GPT Ad library, queues all GPT actions or GPT API calls and executes them when the API is available.

Requirements

  • React 0.14+

Browser Requirements

  • IE10+

Features

  • Single request mode
  • Asynchronous rendering mode
  • Synchronous rendering mode
  • Responsive ads
  • Interstitial ads

Installation

$ npm install --save react-gpt-ad

The component dependency graph is clean i.e. React GPT Ads component is not dependent on any other library.

Usage

Import React GPT and pass props to the component.

import GPTAd from "react-gpt-ad";

class Application extends React.Component {
    render() {
        return (
          <GPTAd
            path="/23389245/sitename/home"
            placement="rectangle"
            size={[300, 600]}
            targeting={{
              pos: 'fn_rectangle1',
              pid: 'front'
            }}
          />
        );
    }
}

path and placement are only required properties for the component to initialize.

About

A React component to display Responsive GPT Ads

Resources

License

Stars

Watchers

Forks

Packages

No packages published