jp3cki / yii2-googleadsense
An extension for displaying Google AdSense ads.
Installs: 3 107
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 2
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.4.0
- yiisoft/yii2: 2.0.*
Requires (Dev)
This package is auto-updated.
Last update: 2024-12-19 06:31:30 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 :
- Add the following parameter to your params.php file to specify your AdSense client ID: 'googleAdSenseClient' => ''
- 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
- 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>' ]); ?>```