Google AdSense (প্লাগইন)
পাবলিশার আইডি, Auto ads, প্রিভিউসহ প্রতিটি বিজ্ঞাপনের জায়গায় একটি ইউনিট, /ads.txt ফাইল, Google-এর কনসেন্ট মেসেজ, ক্যাম্পেইনের কাছে ইউনিট কীভাবে জায়গা ছাড়ে, আর ফাইল-হোস্টিং সাইটের জন্য Google-এর নিয়মসহ সতেরো দফা আয়ের পরামর্শের চেকলিস্ট। ফ্রি।
The Advertising chapter says where adverts go and how a campaign fills a place. The Google AdSense plugin fills the places that have no campaign with Google AdSense: it prints Google's loader, can switch on Auto ads, gives every place its own ad unit with a preview, serves the /ads.txt file AdSense asks for, prints Google's consent message for European visitors, and checks your site against a seventeen-point Earnings advice list that is written for file-hosting sites.
Who it is for
Sites that earn from free downloads and have, or want, an AdSense account. A file host is a hard case for AdSense - the pages are thin, the traffic is mostly downloads - so the plugin spends as much effort on what Google wants to see (privacy page, consent, ads.txt, units in the right places) as on printing the code.
Switching it on
Google AdSense is free and works with every licence. A fresh install switches it on; on a site that was updated, switch it on at Admin → Extensions → Plugins (Manage Plugins) if it is off (Updating). Three pages appear under Extensions, grouped under Google AdSense:
- Google AdSense (
/admin/plugin/google-ads) - the settings and the ads.txt card. - Ad units (
/admin/plugin/google-ads/units) - one unit per place. - Earnings advice (
/admin/plugin/google-ads/advice) - the checklist.
Nothing shows on the site until a publisher id is saved, and nothing shows while Advertising enabled is off or the visitor's package has no Show Site Adverts (Advertising).
The settings
Make an AdSense account for the domain, wait for the site to be approved, then fill in:
General
- AdSense publisher id (
publisher_id) -ca-pub-and sixteen digits, from AdSense → Account → Settings → Account information. Sixteen digits alone orpub-…are completed for you; anything else is saved with a warning and ignored. - Auto ads (
auto_ads, off) - prints the AdSense loader in the<head>of every public page so Google can place ads by itself (switch Auto ads on in your AdSense account too). Off, the loader is printed once, just before the first unit of a page. - Load units when they come near the screen (
lazy_load, on) - a unit far down the page asks for its ad only when the visitor scrolls within about 400 pixels of it: faster pages and better viewability. - Show the word "Advertisement" above each unit (
unit_label, on) - the small grey label Google allows.
Consent
- Google consent message (Funding Choices) (
consent_on, off) - prints Google's consent script for visitors in the EEA, the UK and Switzerland. Create the message first in AdSense → Privacy & messaging. - Funding Choices id (
funding_choices_id) - empty usespub-…taken from the publisher id.
ads.txt
- More lines for ads.txt (
ads_txt_extra) - one line each, for a second network, for exampleadsterra.com, 1234567, DIRECT, abc123.
Advice
- Units to place at least (
min_units, 3) and Units on one page at most (max_units_per_page, 3) - the two numbers the checklist measures against.
ads.txt
The site answers /ads.txt by itself (the plugin adds the route; it needs URL rewriting). The file holds the line google.com, pub-…, DIRECT, f08c47fec0942fa0 made from your publisher id, then your extra lines, without duplicates. With no publisher id and no extra lines the address answers 404. A real file named ads.txt in the site folder is served by the web server before the plugin is asked, so it hides this one - delete it, or add the AdSense line to it. The card on the first page shows the file as it will be served and a button Check that the site serves it, which fetches /ads.txt over HTTP and notes whether your publisher line is in the answer (Read live or Not readable, with the time).
Ad units
AdSense → Ads → By ad unit → Display ads: make a unit, copy the ten digits of data-ad-slot, and paste them into the card of the place on the Ad units page. Every place has a card with:
- Ad slot id - digits only. Empty leaves the place to your campaigns or to nothing.
- Format - Auto, Rectangle, Horizontal or Vertical.
- Responsive (fits the screen) - on by default, so phones get phone sizes.
- the sizes to make for that place (the best ones in bold), a Preview on the page button that opens the Advertising preview for the place, and, once a slot id is saved, a dashed blue stand-in marked AdSense - slot … - format ….
The five player places (before the video, in the middle, the L-shaped frame, when paused, the small banner) are listed with a warning and ignored: AdSense does not allow display ads inside or over a video player, and the two video places play a video or a VAST tag, not a display unit. Use a sponsor video or a VAST tag there.
Save ad units keeps all the cards.
A unit, a campaign and typed HTML
A place is filled in this order, and the first that has something wins:
- a campaign running on the place (Advertising → Campaigns);
- the HTML typed for the place (Advertising → Banner Ads);
- the AdSense unit of this plugin.
So an AdSense unit shows only where the place has neither. The Ad units page says N campaign(s) running here win over the unit on a card, and the checklist warns about it; pause the campaign (the faruk.bd demo set fills every place on a fresh site) or clear the typed HTML to let the unit through. In Advertising → Preview a place with a unit and nothing else shows the same dashed stand-in.
The Earnings advice checklist
The page scores your site live: each Pass counts one point and each Check half a point, and the total over the seventeen checks is shown as a score N / 100 beside the count of passed, to check and to fix. The list begins with what needs Fix, and each line says what to do. The seventeen checks:
- Publisher id is set and valid.
- The site runs on https.
- ads.txt is served - a file in the site folder that hides it, a missing publisher line, no URL rewriting and a failed live check are each named.
- A privacy page (slug
privacy) exists and mentions cookies and Google advertising. Wording to copy sits at the bottom of the advice page, with a Copy button. - The cookie notice is on (Site Settings → Site Options).
- The Google consent message is on, for visitors in Europe and the UK.
- At least Units to place at least units are placed.
- No page carries more than Units on one page at most units. Counted per page, with the header and footer units each: home, download, delayed redirect, search, upgrade and public folder.
- The download page has a top and a bottom unit.
- No AdSense code in the player places - not in a unit, a campaign or typed HTML.
- Contact and About pages exist (the contact form counts as a contact page).
- robots.txt lists the sitemap: the built-in one does; one you typed needs a
Sitemap:line (SEO & Analytics). - Every unit is responsive, so phones get phone sizes.
- No campaign or typed HTML hides a unit.
- No unit on the waiting page (delayed redirect), which has almost no content of its own.
- Adverts are hidden from administrators - clicking or reloading your own ads is invalid traffic.
- Advertising is switched on (the master switch).
Below the list two cards give plain advice for a file host. What earns best: where the visitors come from matters most; put the best units on the download and waiting pages, top and bottom, and keep the rest of the site light; a rectangle usually beats a leaderboard; two or three units beat six; real text on the page earns more and is approved sooner; sell Premium on the download page; compare Auto ads with manual units for a week each; keep a second network for the places AdSense does not allow. What Google forbids: asking for or rewarding clicks; clicking your own ads; ads on pages without content (errors, login, empty search, thank-you or countdown-only pages); an ad over, beside or dressed as the Download button; display ads in a video player, pop-ups and pop-unders; changing the AdSense code or hiding and moving ads with scripts; pirated, adult, hacking or malware files on pages with AdSense; and AdSense on pages that show a member's private files.
Tips
- Start with the download page, top and bottom. That page earns most; add the home page and the file view later.
- Clear every line marked Fix before you apply - https, the privacy page, ads.txt, a contact and an About page. AdSense reviews a file host strictly.
- BoxPuff has no adult-content options, which makes an AdSense review easier (Advertising); answer abuse reports quickly and delete what is reported.
- Test with Hide adverts for administrators on and look at the site in a private window or from your phone, never by clicking.
- A second network goes on the places AdSense cannot use, as a campaign or typed HTML; its
ads.txtline goes in More lines for ads.txt.