- Clone the adsense-pencilblue repository into the plugins folder of your PencilBlue installation
cd [pencilblue_directory]/plugins
git clone https://github.com/pencilblue/adsense-pencilblue.git
-
Install the adsense-pencilblue plugin through the manage plugins screen in the admin section (/admin/plugins).
-
Go to the adsense-pencilblue settings screen (/admin/plugins/settings/adsense-pencilblue) and set Ad client id to your Adsense client ID (ca-pub-#) and save.
-
Add your first Adsense ad:
-
Click on the Manage Ads button on the adsense-pencilblue settings page.
-
Create a unique name for your first ad
-
On Adsense's management panel, copy the ID of the ad you want to save and paste it into the ad_id field of PencilBlue's new_adsense_ad form.
-
Save the adsense_ad object.
-
Now there will be a directive available in your HTML templates of ^adsense_[ad name]^. For instance, if you name your ad "leaderboard," the directive is ^adsense_leaderboard^.
- Note: if you add the directive and restart the server before you save the ad type it will not be loaded until you click the Refresh Directives button on the adsense-penciblue settings screen.