Ad code implementation

Create an ad unit

To create a new AdSense ad unit that you can manage within your account, follow the steps below:

Visit the My ads tab.

In the sidebar, select your product. For example, if you want to display ads on your website, select "Content."

Click +New ad unit.

Give your ad unit a name. It’s a good idea to use a unique, descriptive name that will help you find this ad unit later.

In the “Ad size” section, choose the size of the ads that you’d like to show:

We suggest that you leave the “Recommended ad sizes” option selected. If you want to view other ad sizes, select a different option from the Showing drop-down.

In general, wider ad units perform better. We encourage you to choose one of our recommended ad sizes, which have shown to perform well across a variety of sites. Ad sizes that perform well on mobile are shown with a mobile icon .

(Optional) Click Preview if you’d like to see an example of how an ad looks.

Select your desired ad size.

Select which type of ads you’d like to show on your pages from the Ad type drop-down.

We highly recommend that you display both text and display ads. By displaying more ad types, you can earn more revenue.

Custom channels are an advanced feature that you can use to group specific ad units together and track their performance. Learn more about custom channels. To add a custom channel to track your ad unit, in the “Custom channels” section, either:

Select an existing custom channel from the list by clicking the arrow button.
or

Click Create new custom channel, and then in the “Add new custom channel” window that opens:

Give your custom channel a name that clearly describes what types of ad units you are tracking with the channel, and that will help you identify it later. For example, car_pages or blue_skyscrapers.

Choose any additional ad units to track with this channel by clicking the arrow button.

If you'd like this custom channel to appear to advertisers as a targetable ad placement, select the Show this custom channel to advertisers as a targetable ad placement checkbox, and enter the requested details. Or, leave it unchecked to create a custom channel for tracking purposes only.

Click Save.

From the Backup ads drop-down, choose what you’d like us to show on your page if Google has no targeted ads available. Learn more about backup ads.

Click Save and get code.

Choose the code type that you want to use:

To use the asynchronous ad code, leave the code type set to "Asynchronous" in the Code type drop-down.

If you want to use the existing AdSense ad code, select "Synchronous" from the Code type drop-down.

Copy and paste the ad code into the HTML source code of your pages where you'd like ads to appear. If you're not sure how to do this, you might want to review our Code Implementation Guide.

Once you've saved your website, ads will appear within a few minutes.

If you need to change the settings of this ad unit in the future, you can edit it from the list of ad units under your My ads tab.