Integrating AdSense with WordPress is easy. Google makes it easier and easier to handle implementation of code and and if you haven’t done advertising on your own site before you might find yourself hooked trying to optimize their size and placement.
Step 1. Apply For an AdSense account
If you haven’t already you can signup for an AdSense account on the Google AdSense website. Be sure to read the requirements. They will review your application and usually reply within 24 hours. Part of the application requires you to implement a sample ad on your site which we’ll cover next.
Step 2. Creating your first Ad Unit.
Google gives you a really nice walk-through when you signup for a new account. I suggest you follow it and create a sample ad of any size to get authorized to use real ads on your site. So now what? You can use the “get code” link to see the code you’ll need on your site. Armed with this we can now look at how to get this on your site.
Step 3. Implementing Code.
There are a number of ways to get the required code onto your webpage(s). From using plugins to placing the code directly on your webpage. I find that using widgets are one of the easiest and can be used in many different ways from a design perspective. In any case you will want to choose one to get rolling with your account.
Directly on a Page
You could also paste the code itself to a particular page in Text view but I don’t recommend doing this. You might want to change something about your ad later on and have to go back to individual pages and edit them.
For example, if I wanted to have an ad show up in the sidebar on any page you could simply paste the code into a text widget via the Appearance->Widgets interface.
Add it to the Theme
You can also directly copy the script to the .php file driving your header or page and really place the ad where you want it. This differs theme by theme and can be annoying in many cases.
A Mixed Approach
I recommend a mixed approach. Adding a div in your theme’s Header.php for example would let you place an ad across the top of your site, for example which is a good spot for a banner ad. You could also just simply place the code in a text widget on any sidebar and easily make it available anywhere you wanted. You can also try a plugin like Widgets on Pages and place them anywhere in the post you wanted and still be able to easily change multiple at a time using the widget.
Here is an example where the header was edited to include a banner image and a regular skyscraper was used on the sidebar of every page:
Taking It Forward
There are an endless sea of WordPress themes out there and many of them claim to be AdSense friendly. In my experience using AdSense is really very easy but using WordPress to accommodate the best sizes can be difficult for a novice with CSS and/or PHP. Now that Google has modified their recommended ad sizes and are likely to continue to, it renders some out-of-the-box theme obsolete. If you’re trying to avoid using CSS look for a theme that has a sidebar wide enough to accommodate the size ad you want.
Here are the sizes they suggest:
- the 336×280 Large Rectangle
- the300x250 Medium Rectangle
- the160x600 Wide Skyscraper
- the728x90 Leaderboard
- the300x600 Half Page
So a sidebar with room for a 300px wide ad would work well since you could use the 336×280 Large Rectangle or the300x600 Half Page. You could always use the 336×280 Large Rectangle anywhere on a post also.
If you know some CSS/PHP you can always edit the column widths and create a layout that works well. Placement and tuning are huge for Click Through Rate (CTR).