Search Images Maps Play YouTube News Gmail Drive More »
Sign in

AdSense for content (AFC)

Code implementation guide

Get and copy the ad code

To implement an ad unit or search box, you must first generate the AdSense ad code in your AdSense account. If you haven’t created an ad unit or search box yet, follow these steps.

After you've customized the appearance and settings of your ads or search box, the code you generated is displayed in the Ad code box.

This is the ad code you will copy and paste into your site's HTML source code.

If you've already created an ad unit but haven’t implemented the code yet, you can retrieve its code:

  1. Visit the "My ads" tab, find your ad unit in the list, and and click "Get code".
  2. Select the code by clicking anywhere in this box. You'll see the code highlighted in blue.
  3. Next, from your browser's Edit menu, choose Copy to copy the highlighted area.

Tell us how we're doing - Answer five short questions about your help center experience

Be sure to sign in to your account for a more customized Help Center experience.