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:

  1. Visit the My ads tab.
  2. In the sidebar, select your product. For example, if you want to display ads on your website, select "Content."
  3. Click +New ad unit.
  4. 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.
  5. In the “Ad size” section, choose the size of the ads that you’d like to show:
    1. 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 mobile icon.
    2. (Optional) Click Preview if you’d like to see an example of how an ad looks.
    3. Select your desired ad size.
  6. 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.
  7. (Optional) Apply an ad style for your text ads.
    View details
    Ad styles give you control over how text ads will look on your site. Learn more about choosing the right ad style.
    To apply your text ad style, in the “Text ad style” section, either:
    • Select an existing ad style. Learn more about our predefined ad styles.
    • Edit an existing ad style: select the ad style that you want to edit, click Copy, change the color and font settings, and then click Save. The edited style is saved as a new custom ad style.
      or
    • Create your own custom ad style: click Create new style, choose your own color and font preferences, and then click Save.
  8. (Optional) Set up a custom channel to track your ad unit.
    View details
    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:
      1. 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.
      2. Choose any additional ad units to track with this channel by clicking the arrow button.
      3. 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.
      4. Click Save.
  9. 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.
  10. Click Save and get code.
  11. 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.
  12. 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.

Create an ad unit

Was this article helpful?