In this article, you'll learn how to:

Insert the Google AdSense code into your website

Within Hostinger Website Builder, access the integrations settings and find the Custom code field. Insert your Google AdSense code there:

Save the changes and update your website. Now, it's time to set up ads (see below).


Create ads

You can choose from two types of ads:

Auto ads

Ad units

Google itself decides which ads to show and where to show them, allowing you to focus on creating quality ad content

You can select from a range of ad types and ad sizes, and position your ads exactly where you want them to appear on your pages

You control all the ads with the flick of a switch

It's up to you to ensure that your ads comply with the AdSense program policies

Auto ads work on mobile, tablet, and desktop and provide good ad coverage on your pages

Google will only show Auto ads when they're likely to perform well and provide a good user experience

Set up auto ads

Before you begin, make sure that your website is listed on your Ads page. Learn more: Add a new site to your sites list

Follow this guide by Google AdSense: How to set up Auto ads.

Create display ad units

Follow this guide by Google AdSense: Create a display ad unit. Copy and paste the ad unit code into your website using the embed code element.

NOTE: It takes up to an hour for the ads to appear on your website; if it takes longer, check if your website has the status Ready: Check the status of AdSense sites


Find the code of your ads

Auto ads

Follow this guide by Google AdSense: How to get and copy the code for Auto ads.

Copy the AdSense code, and paste it into the <head></head> part of your website's code.

Ad units

Follow this guide by Google AdSense: How to get and copy the code for ad units. Copy the ad unit code, and paste it into your website using the embed code element.

NOTE: It takes up to an hour for the ads to appear on your website; if it takes longer, check if your website has the status Ready: Check the status of AdSense sites


Upload an ads.txt file to your website

Creating your ads.txt file allows you to control who can sell ads on your website and it's a practice highly recommended by Google.

Once you create the file, open your website's integrations settings, and paste the file into the Google AdSense field:

Your ads.txt file should look like this, where pub-0000000000000000 is your publisher ID: google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0.

Finally, save the changes and update your website.

Did this answer your question?