jp3cki/yii2-googleadsense

An extension for displaying Google AdSense ads.

Installs: 2 106

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 3

Open Issues: 0

Type:yii2-extension

v2.0.0 2015-10-15 13:09 UTC

This package is auto-updated.

Last update: 2020-11-18 22:03:57 UTC


README

An extension for displaying Google AdSense ads.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist jp3cki/yii2-googleadsense "*"

or add

"jp3cki/yii2-googleadsense": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed :

  1. Add the following parameter to your params.php file to specify your AdSense client ID: 'googleAdSenseClient' => ''
  2. Optionally, disable ads in your development environment and show a placeholder instead by adding the following parameter to your params-local.php file: 'googleAdSenseEnable' => false
  3. Use the widget where you want ads as follows:
	'slot' => '<the ID of the ad slot>',
	'style' => '<optional style information>',
	'responsive' => '<optional value specifying whether the ad unit is responsive; defaults to false>'
]); ?>```