- Sign in to your AdSense account.
- 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.
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
.
- Select the type of ads that you’d like to show on your pages from the Ad type drop-down menu. We highly recommend that you display both text and display ads. By displaying more ad types, you can earn more revenue.
- (Optional) Apply an ad style for your text ads. Find out more about choosing the right ad style.
- (Optional) Set up a custom channel to track your ad unit. Find out more about custom channels.
- In the "Backup ads" section, leave the drop-down menu set to "Show blank space" (the default) unless you’d like to show something else if Google has no targeted ads available. Find out more about backup ads.
- Click 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. Find out more about asynchronous ad code.
If you've chosen to create a
responsive ad unit, you won't see the
Code type drop-down menu 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.
- Copy all of the ad code, e.g. press Ctrl+C (Windows) or ⌘+C (Mac).
Where to paste the ad code in your HTML:
It's important that you paste the ad code between the <body>
and </body>
tags of your page. If you paste the ad code outside the <body>
tags it will prevent your ads from appearing correctly.
Example HTML page before the ad code has been added
<html>
<head>
This is the head of your page.
<title>Example HTML page</title>
</head>
<body>
This is the body of your page.
</body>
</html>
Example HTML page with the ad code added in the body
<html>
<head>
This is the head of your page.
<title>Example HTML page</title>
</head>
<body>
This is the body of your page.
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Homepage Leaderboard -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1234567890123456"
data-ad-slot="1234567890"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</body>
</html>
Note that this is sample code only, so please don't use it in your own site's code.
Positioning the ads on your site with HTML
Just like the other elements of your site (images, paragraphs, etc.), you can change the position of your Google ads by using HTML tags (<div>
, <table>
, etc.). For example, if you surround your ad code with the HTML tags <div align="center">
and </div>
, your ads will appear in the centre of your page.
<html>
<head>
This is the head of your page.
<title>Example HTML page</title>
</head>
<body>
This is the body of your page.
<div align="center">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Homepage Leaderboard -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1234567890123456"
data-ad-slot="1234567890"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</body>
</html>
Note: that this is sample code only, so please don't use it in your own site's code.
Paste the ad code in your page:
Once you've copied the ad code from your AdSense account, the next step is to paste it in your page’s HTML source code. How you go about this will depend on the tools that you use to edit your site.
Before adding the ad code to your page, please make sure that your page complies with the
AdSense programme policies. If your page doesn't comply with these policies, we reserve the right to disable ad serving to your site and/or disable your AdSense account at any time.
HTML editors
Many publishers use a design-enhanced HTML editor like Macromedia Dreamweaver (also know as WYSIWYG or "what you see is what you get" software). To ensure your ads work properly, make sure that you paste the ad code into the HTML source code of your page using the editor's HTML view or HTML insert function. You might see errors if you paste your ad code into a WYSIWYG view such as a "Design" view. Once you've pasted your code, check for any additional tags inserted by the software or changes in the line breaks, as they might cause your ads not to show correctly.
If you can't find the HTML source code of your page in your editor, please visit the help centre or support group for your HTML editing software.
Content management systems (CMS)
If you're using a content management system, check below to see if your CMS has AdSense built in or if it supports a plugin that can help you to implement your AdSense ad code.
Sites with AdSense built in
CMS software with official Google plugins
CMS software with unofficial plugins
The following content management systems (CMS) use third-party plugins to insert AdSense ads on the pages generated by the system. Google does not endorse or support these plugins. However, you can use these plugins as long as the ad code displayed on your page remains unchanged and isn't altered by the plugin in any way.
If you need assistance with a plugin, then please visit the official support forum of your service or the developer of the plugin. Please note that Google is not responsible for malicious third-party plugins.
If you have trouble implementing AdSense with a specific content management system, we recommend searching for the name of the CMS (e.g. Drupal, WordPress, etc.) and "AdSense implementation". You can also ask in the forum if other publishers have mastered similar problems, or contact your programme provider directly.
Thanks for sharing such beautiful information for us. I hope you will share some more info about Google Absence. Please keep sharing. Digital Marketing Company
ReplyDeleteThanks for sharing such a great information, Hope you will publish more.
ReplyDeleteI really appreciate the blog,
Please publish more blogs like this
To know more about DIGITAL MARKETING do visit the below mentioned Link-
DIGITAL MARKETING
Again thanks for providing great quality blogs...
Valuable for information, if there are any other blogs related to this then kindly update us
ReplyDeleteTop Blogs For Digital Marketing in 2019