Extension:Google AdSense
A request to archive this extension has been made on Phabricator. See T413585 for the archival request and the rationale for the request, and to leave comments about the request. |
This extension is incompatible with MediaWiki 1.39 or any later release! MediaWiki developers are invited to pledge their efforts to updating this extension to make it compatible with MediaWiki 1.45 by replacing the {{Incompatible}} template with {{Incompatible|version=1.39|pledge=~~~~}}. |
Pengaya ini sekarang sedang tidak aktif dipelihara! Meskipun mungkin masih bisa bekerja, laporan kekutu atau permohonan fitur apa pun kemungkinan besar akan diabaikan. Jika Anda tertarik untuk mengambil tugas mengembangkan dan memelihara pengaya ini, Anda dapat meminta kepemilikan repositori. Sebagai bentuk kesopanan, Anda mungkin ingin menghubungi si pengarang. Anda juga harus menghapus templat ini dan mencantumkan diri Anda sebagai pihak yang memelihara pengaya di kotak info {{Pengaya}} pada halaman tersebut. |
Status keluaran: tak terawat |
|
|---|---|
![]() |
|
| Penerapan | Kulit, Pengait |
| Deskripsi | Memungkinkan menambahkan Google AdSense ke bilah sisi |
| Perancang | Siebrand Mazeland (Siebrandbicara) |
| Pemelihara | Zoran Dori |
| Versi terbaru | 3.1.0 (2021-01-07) |
| MediaWiki | 1.29+ |
| PHP | 7.0+ |
| Perubahan pangkalan data | Tidak |
|
|
|
| Lisensi | Lisensi MIT |
| Unduh | |
| Terjemahkan pengaya Google AdSense jika tersedia di translatewiki.net | |
| Masalah | Tugas terbuka · Laporkan kekutu |
The Google AdSense extension allows to easily add Google AdSense advertisements to the sidebar of your wiki. This extension requires an account with Google's AdSense.
Pemasangan
- Unduh dan pindahkan folder
GoogleAdSenseyang diekstrak ke direktoriextensions/Anda.
Pengembang dan penyumbangsih kode sebaiknya memasang pengaya dari Git sebagai gantinya, menggunakan:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/GoogleAdSense
- Tambahkan kode berikut di bawah berkas LocalSettings.php Anda:
wfLoadExtension( 'GoogleAdSense' );
// Replace this with your own publisher ID (google_ad_client / data-ad-client) $wgGoogleAdSenseClient = 'none'; // Client ID for your AdSense script (example: ca-pub-1234546403419693) // Replace this with your AdSense ad unit ID (google_ad_slot / data-ad-slot) $wgGoogleAdSenseSlot = 'none'; // Slot ID for your AdSense script (example: 1234580893)
(You can get your "publisher ID" and "ad unit ID" from the "Get code" page.)
- Add any of the optional settings below - if your settings deviate from the defaults:
// Width of the AdSense unit, specified in your AdSense account (google_ad_width / data-ad-width)
$wgGoogleAdSenseWidth = 120;
// Height of the AdSense unit, specified in your AdSense account (google_ad_height / data-ad-height)
$wgGoogleAdSenseHeight = 240;
// Source URL of the AdSense script. No need to change - it can't deviate from the defaults.
$wgGoogleAdSenseSrc = '//pagead2.googlesyndication.com/pagead/show_ads.js';
// Show the AdSense box only for anonymous users: true or false. Default is false.
$wgGoogleAdSenseAnonOnly = false;
// This can be anything you like. Default is 'none'.
$wgGoogleAdSenseID = 'none';
// Text coding. Default is 'utf8'.
$wgGoogleAdSenseEncoding = "utf8";
// Advertising language. Default is 'en'.
$wgGoogleAdSenseLang = "en";
- If you want to add a "Text/image, 200x200" into the Vector skin you will need to shift the left panel over slightly. Add the following to the "MediaWiki:Vector.css" page
#content,
#footer {
margin-left: 11em;
}
#left-navigation {
left: 11em;
}
- The default portlet label ("Advertisements") can be changed to "Sponsored Links" on the "MediaWiki:Googleadsense" page. Please note: no other variations are permitted[1].
- Remember to disable ad-blocking services such as AdBlock when you want to see if the extension is working!
Selesai – Telusuri ke Special:Version di wiki Anda untuk memastikan pengayanya berhasil dipasang.
If you encounter an HTTP 500 error, replace "wfLoadExtension( 'GoogleAdSense' );" with "require_once "$IP/extensions/GoogleAdSense/GoogleAdSense.php";".
Lihat pula
- Widget for Google AdSense display within wiki pages (not within the skin)
- ShoutWiki Ads
- WimaAdvertising
- PCR GUI Inserts
Referensi
- ↑ AdSense Help: Ad placement policies: Placing ads under a misleading header

