Print

How to Create AdSense Code

  1. Sign in to your AdSense account.
  2. Visit the My ads tab.
  3. In the sidebar, select your product. For example, if you want to display ads on your website, select “Content“.
  4. Click +New ad unit.

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.
    In general, wider ad units perform better.

adsense 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.

adsense ad type

  • By displaying more ad types, you can earn more revenue.
  • Click Save and get code.

save_and_get_code

  • In the “Ad code” box that opens:
    Leave the code type set to “Asynchronous” (the default), unless you want to use synchronous ad code.
    If you’ve chosen to create a responsive ad unit, you won’t see the Code type drop-down in the “Ad code” box. Responsive ad units only use asynchronous ad code.
  • Select the ad code by clicking it. You’ll see the ad code highlighted in blue.Example of the “Ad code” box
    adsense ad codeCopy all of the ad code, e.g., press Ctrl+C (Windows) or ⌘+C (Mac) and paste it into the WP QUADS ad code form:
  • Go to WP QUADS > AdSense Code
  • Click on Copy / Paste AdSense Code
copy_paste_adsense_code
Copy and paste ad code

A popup window is opening where you can paste the ad code from your AdSense dashboard

code_popup

Click on Get Code and the fields Slot ID and Publisher ID will be populated automatically. Instead pasting the complete AdSense code you can also populate the Slot and Publisher ID manually if you already know these values.

ad_slot_publisher_id

In the next step, select if you like to create an AdSense responsive ad or one with a fixed size

responsive

Let’s define a few layout options, specify if the text should be floated around your ad and assigning margin values which add some space beside the ad.

layout

If you are using WP QUADS PRO you can also disable the ad on specific devices and you are allowed to define different ad sizes depending on the type of user device, whether it’s a desktop, tablet, or mobile device your visitor is using.

advanced_settings

In the last step you can decide if if you want to activate the ad on AMP pages. This only works if you are using the AMP plugin by automattic

google_adsense_amp

After doing this you just need to activate this ad.

You need to do this on the tab General & Position:

You are done.

Go to the frontpage, look at a post and see the ad appearing!

If ads are not showing check out the troubleshooting guide.