Need help with react-gpt?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

137 Stars 75 Forks MIT License 86 Commits 63 Opened issues


A React display ad component using Google Publisher Tag

Services available


Need anything else?

Contributors list

React GPT

npm Version Build Status Dependency Status PRs Welcome

A React component for Google Publisher Tags.


  • React 0.14+

Browser Requirements

  • IE10+


  • Supports all rendering modes (single request mode, async rendering node and *sync rendering mode)
  • Supports responsive ads.
  • Supports interstitial ads.
  • Supports lazy render.

* Synchronous rendering requires that the GPT JavaScript be loaded synchronously.


$ yarn react-gpt

React GPT depends on Promise to be available in browser. If your application support the browser which doesn't support Promise, please include the polyfill.

Getting Started

Import React GPT and pass props to the component.

import {Bling as GPT} from "react-gpt";

class Application extends React.Component { render() { return ( ); } }

You at least need to pass

and one of

Enabling Single Request Mode

To enable Single Request Mode, call

before rendering any ad. It defaults to
Asynchronous Rendering Mode
if not set.
import {Bling as GPT} from "react-gpt";


class Application extends React.Component { render() { return (

); } }

The above example will make one request to the server to render both ads which makes it easier to ensure category exclusion.

Responsive ad

If you pass

props instead of
, React GPT listens for the viewport width change and refreshes an ad when the break point is hit.
import {Bling as GPT} from "react-gpt";

class Application extends React.Component { render() { return ( ); } }

API and Documentation

To run examples:

  1. Clone this repo
  2. Run
  3. Run
    npm run examples
    for client side rendering,
    npm start
    for server side rendering.
  4. Point your browser to http://localhost:8080

Contributing to this project

Please take a moment to review the guidelines for contributing.



We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.