How to Add Google AdSense Code to Your Blog

Scarlett Schreiber Scarlett Schreiber
Reading time:  6  min.

To monetize and promote your blog, contextual advertising might be one of the best ideas, and Google AdSense is the most appropriate network for that purpose. In this article, you will learn what Google Adsense is, how to sign up for it and how to integrate its code to your website.

How to Add Google AdSense Code to Your Blog

What Is Google AdSense

Google AdSense is a contextual advertising network working as a mediator between advertisers and publishers. It uses the pay per click (PPC) model, meaning that publishers are paid every time someone clicks on the ad placed on their website. Naturally, the more traffic you have, the bigger the chance to receive clicks on the ads.

What is Google AdSense

Here are some benefits of working with Google AdSense: 

  • Access to many advertisers
  • Full security is provided
  • It is free to join 
  • Ads are relevant to the content and normally aren’t intrusive

How much can you earn with Google AdSense? The income is determined by the level of competition within the niche. The most profitable fields are insurance and loans, and they can bring even more than one dollar per click for a publisher. Ad placement, audience interests, and ad formats influence the income as well. The CPC rate varies as well from country to country.

Webmasters have only a few opportunities to control advertisements from ad blocks, so it may be contrary to the website content. For example, if you have a travel blog, your audience may see irrelevant ads about real estate, cars, and so on. 

If you want to monetize your website and avoid displaying irrelevant information, you can join affiliate marketing networks. One example is the Travelpayouts partnership platform which gives access to over 100 travel brands, including well-known names, such as, TripAdvisor, GetYourGuide, and many more.

You don’t need to have experience launching ads on Google AdSense to earn on the promotion of travel brands. For example, you can register to Travelpayouts, connect to the travel affiliate programs of your favorite travel brands, and use their banners. Simply copy the code and paste it into the pages of your site. You will earn every time that users click on your banner and purchase a travel service. Using tools and connecting to Travelpayouts is absolutely free. Try and compare the advantages of Google AdSense and Travelpayouts now.

Join the Travelpayouts Partnership Platform

Access exclusive tools and the best travel partner programs, including flights, hotels, car rental, insurance, tours, and activities, all in one place.

Join Today
480,000 partners already trust us
$63M+ total paid since 2011
60+ travel brands

If you want to discover the best practices on how to earn with Google AdSense on your blog, check out our guide.

How to Sign Up for Google AdSense

To let Google AdSense show ads on your blog, it’s necessary to create an account that is absolutely free. You can sign in with your current Google account or create a new one.

How to sign up for Google AdSense

You’ll be asked to type in your website’s URL, choose your country, full name, address and phone number.

When the registration is over, you have to wait a couple of days for Google’s approval.

How to Get Google AdSense on Your Blog

The procedure varies depending on your blogging platform. Below, you’ll find instructions for HTML, WordPress, Joomla and Blogger-based websites.

HTML Website

Once Google has approved your account, log in and find your HTML code located under the “AdSense Setup” tab. The best AdSense formats are at your disposal since you can pick either texts or images, as well as their combination. Having chosen the ad format, copy the code and paste it into your web page.

HTML website

Here are some AdSense placement tips:

  • Put the code inside the “Main Content” or “Sidebar” zones in your main HTML pages, but not in a footer.htm or sidebar.htm. Consider using various ad sizes and creating responsive ads.
  • A “div” can be used for placing the ads anywhere on the page via CSS code. Don’t fix the ad since Google doesn’t allow it to scroll in sync with the webpage.
  • If your website features “sidebar.js” or “sidebar.htm,” it’s possible to locate the ad in the sidebar without integrating the code in the .js or .htm file. 

Then, the ads will locate the niche, topic or product details on your HTML website in an auto mode. Since they’re able to read the text on the webpages, they “understand” which ads will correspond to your site content and deliver them to your webpage. Don’t forget to make file backups of your webpages and avoid clicking on your own ads to not get banned. 


Note that codes can be added only if you use WordPress CMS or have a premium subscription to or Free plans don’t allow for blog monetization. 

Basically, there are two ways of adding AdSense code to a WordPress website, depending on whether you will change the theme in the future. 

If you don’t plan to change your website theme, do the following to add AdSense code: 

  1. Enter the WordPress dashboard.
  2. Find the “Editor” option and click on it.
  3. View the Theme files and select the Theme Header.
  4. Insert the code below the <head> tag. In-between the tags of your pages.
  5. Click the button “Update File” to confirm changes.

To be able to change the theme in the future, insert AdSense code in the following way:

  1. Download WordPress Headers and Footers plugin.
  2. Choose Settings and find the header and footer scripts to click on.
  3. Add the code.
  4. Press “Save Settings” or “Update” to confirm changes.
  5. Check the checkbox and press “Done.”

Then, you should wait for approval to start creating and adding ads to your website. To insert the ads inside articles, you can use ready-made plugins, such as Ad Inserter or WP QUADS.


  • Login to your Joomla website as an administrator.
  • Find the “Extension” section and choose “Module manager.”
  • Click on the “Custom HTML” on the control panel to create a new Module.
  • Before copying the code that you’ll see in this tab, choose the title and placement for your ad and only then insert the code into the Custom Output field (text editor).
  • Save all the changes and open a new browser window.
  • Type http://localhost/joomla, and you’ll see a new ad in the appropriate location.


Here is what you can do to insert AdSense code on your Blogger website. First, sign in to Blogger and open the “Earnings” tab. 

Your blog needs to qualify for AdSense, and once you meet the eligibility requirements, press the “Sign up for AdSense” button.

Then, it’s necessary to type in your website URL and content language. And after saving the changes, you can customize ad settings. You can configure ads placement, display frequency, ad format and colors in your AdSense account. 

Things to Keep In Mind

First, make sure that putting ads on the website won’t hurt your brand growth. Promoting the products and services of other companies can distract your potential customers if you haven’t established the authority yet.

It is always important to comply with the policies to not get banned and lose investments later. One of the most important things to keep in mind is to not click on your own ads. Also, your website should only contain unique content. 

As for ads settings, note that you can place only three ad units on a page. That’s why you shouldn’t pick the smallest or the largest formats. The first former isn’t noticeable and the latter affects user experience. 

Ad placement is another important point. Certain website sections are considered more profitable for ads than others. For example, it’s recommended to place a banner near the main content so that it doesn’t hide from any reader’s attention. However, everything depends on website design. Besides, the right placement is a consequence of experience. That’s why it’s important to integrate AdSense in Google Analytics in order to test various ad placements and find the most profitable one.

Finally, to make good money with AdSense, your website should have a lot of traffic. And, traffic from social media is likely to bring less income than expected so try to not have high expectations for it.

Apart from Google AdSense, many other ad networks will allow you to earn money from travel blogging, which you can also take a look at when monetizing your website.

Getting Started 

AdSense is a great platform for blog monetization through advertising.

First, you’ll need to apply for Google’s approval, and if your website is eligible, you can get to work. To start earning, you’ll need to add AdSense code to your blog, but the process slightly differs for each blogging platform.

However, it is important to choose the right ads and configure them in the most efficient way. As an addition to the contextual ads, you may make money on blogs with travel affiliate programs.

15 AI Tools Tackling Travel Bloggers' Top Challenges