This recipe shows you how to place an ad on a Sitecore site using AdPlugg. This recipe just adds a single ad but you can use it to add any number of ads by combining it with other recipes, etc. The recipe uses the AdPlugg Snippet, which will work on any site, but the instructions in this recipe are specific to a Sitecore site.
Create An Ad
First, we need to create an AdPlugg Ad.
- From within your AdPlugg account, create an Ad and upload an ad image (see the Ad Help Page).
Add the AdPlugg JavaScript SDK to Your Sitecore Site
Next we are going to add the AdPlugg JavaScript SDK to your Sitecore Site. This allows you to place and run AdPlugg ads on your Site.
- Log into the Sitecore admin and go to the Content Editor.
- In the content tree panel on the left, go to sitecore/Layout/Layouts.
- Edit the “Main Layout”.
- From within your account at adplugg.com, click "Download" and then "Snippet".
- Click the "Get The Snippet" button (at the bottom).
- Copy the AdPlugg SDK and paste it into the Main Layout right after the opening <head> tag.
- Publish your changes.
- Repeat the above for any other Layouts as necessary.
Add an AdPlugg Ad Tag
Now we are going to add an AdPlugg Ad Tag to your Sitecore page using a Sitecore Rich Text Field.
- From in the Sitecore admin, go to the Experience Editor.
- Add a Rich Text Field to wherever your want the ad to appear.
- In the Rich Text Field editor, switch to HTML mode by clicking the HTML tab at the bottom.
- From your AdPlugg dashboard, go to Download and then Snippet. Click the "Get the Snippet" button (at the bottom) and then copy the Ad Tag to your clipboard.
- Paste the Ad Tag code that you copied above in to the HTML box in Sitecore.
- Save the field and publish.
Adding More Ads!
You can insert ads into other areas of your Sitecore Site using the same technique that we used above.
You can also use AdPlugg Zones to serve different (or the same) ads into these various areas.
Check out the other recipes in the AdPlugg Cookbook for more cool things that you can do with the ads on your Sitecore site including scheduling, page targeting, rotation and more.