I use this extension.
When I no set $wmGoogleAdSense* series, because I set auto ad in adsense, not show any ad.
And I set '$wmGoogleAdSense* series, it only show "Advertisement" area, and not show any ad.
I use this extension.
When I no set $wmGoogleAdSense* series, because I set auto ad in adsense, not show any ad.
And I set '$wmGoogleAdSense* series, it only show "Advertisement" area, and not show any ad.
First: Enable Google Adsense $wmGoogleAdSense = true;
Second: Define slots $wmGoogleAdSense_AD1= [ 'slotid 1', 145, 260 ]; $wmGoogleAdSense_AD2= [ 'slotid 2', 145, 260 ]; $wmGoogleAdSense_Top= [ 'slotid 3', 145, 260 ]; $wmGoogleAdSense_Bottom = [ 'slotid 4', 145, 260 ];
Third: $wmGoogleAdSenseClient = 'pub-your_number'; $wmGoogleAdSenseID = 'any text but empty';
Do not forget to set AD1 and AD2 in MediaWiki:Sidebar, if you use the slots in the sidebar.
See i.e.
and look for "slotid 1", "slotid 2", "slotid 3", and "slotid 4".
Settings are: $wmWimaAdvertising = false; $wmGoogleAdSense = true; $wmGoogleAdSense_AD1= [ 'slotid 1', 145, 260 ]; $wmGoogleAdSense_AD2= [ 'slotid 2', 145, 260 ]; $wmGoogleAdSense_Top= [ 'slotid 3', 145, 260 ]; $wmGoogleAdSense_Bottom = [ 'slotid 4', 145, 260 ]; $wmGoogleAdSenseClient = 'pub-9471398824076666'; $wmGoogleAdSenseID = 'ID 007'; $wmGoogleAdSenseSrc = 'https://pagead2.google_syndication.com/pagead/js/adsbygoogle.js?client=ca-pub-xxxxxxxxxxxxxx';
I can't test this any further because I don't have a Google Adsense account.
It shows:
<script type="text/javascript" src="https://pagead2.google_syndication.com/pagead/js/adsbygoogle.js?client=ca-pub-xxxxxxxxxxxxxx">
</script>
<script type="text/javascript"><!--
google_ad_client = "pub-9471398824076666";
/* ID 007 */
google_ad_slot = "slotid 3";
google_ad_width = 145;
google_ad_height = 260;
google_language = "de";
google_encoding = "utf8";
// -->
</script>
--WikiForMen (talk) 22:53, 14 August 2024 (UTC)
If you really did not make a configuration error and it does not work, please try version 2.4.0 of WimaAdvertising and give me a report.--WikiForMen (talk) 23:11, 14 August 2024 (UTC)
Thanks for reply,
I use 2.4.0, it's a:so can't show anything.
wfLoadExtension( 'WimaAdvertising' );
$wmGoogleAdSense = true ;
$wmGoogleAdSenseAnonOnly = false;
$wmGoogleAdSenseClient = 'pub-*';
$wmGoogleAdSenseSrc = '//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
$wmGoogleAdSense_AD1 = [ 'xxxxx' , 'auto' , 'auto' ];
$wmGoogleAdSense_AD2 = [ 'xxxxx' , 'auto' , 'auto' ];
$wmGoogleAdSense_Top = [ 'xxxxxx' , 'auto' , 'auto' ];
$wmGoogleAdSense_Bottom = [ 'xxxxx' , 'auto' , 'auto' ];
By the why, it will cover my Sitenotice content.
"can't show anything" AND "it will cover my Sitenotice content"?!??
How can it cover your Sitenotice content, if it didn't show anything.
By the way, this is nearly impossible.
Please use the link:
and look for "slotid 1", "slotid 2", "slotid 3", and "slotid 4".
view-source:https://yourdomain.org
and look into your own HTML-Sourcecode.
It should show something.
At least I see inserted HTML code on "41.wikimannia.org", although no ads are displayed for me either, which is due to the fact that I do not have a Google AdSense account, so the link to Google AdSense does not take effect.
Could you please give me the URL of your wiki so that I can take a look at the HTML source code on your page?--WikiForMen (talk) 13:14, 15 August 2024 (UTC)
like this:
I set 4, but source only show 1.
If top show "Advertising:"(text) and replace my sitenotice, and no any ad.
The ad at the top should alter randomly with sitenotice.
As I told you, you should set AD1 and AD2 in MediaWiki:Sidebar:
* navigation
**mainpage|mainpage-description
**recentchanges-url|recentchanges
**randompage-url|randompage
**helppage|help-mediawiki
* AD1
* 主要
**ガチャ|ガチャ
**楽曲|楽曲
* メンバー
**日野下花帆|日野下花帆
**村野さやか|村野さやか
**乙宗梢|乙宗梢
**夕霧綴理|夕霧綴理
**大沢瑠璃乃|大沢瑠璃乃
**藤島慈|藤島慈
**百生吟子|百生吟子
**徒町小鈴|徒町小鈴
**安養寺姫芽|安養寺姫芽
* SEARCH
* AD2
* TOOLBOX
* LANGUAGES
In the HTML-Code I see:
<script type="text/javascript" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">
</script>
<div id="siteNotice" class="notheme"><div style="clear:both; margin-top:1em; text-align:left;"><p>Advertising:</p><div style="border:1px solid black; text-align:center;"><script type="text/javascript"><!--
google_ad_client = "pub-9543960077946929";
/* none */
google_ad_slot = "5512254708";
google_ad_width = 0;
google_ad_height = 0;
google_language = "zh-tw";
google_encoding = "utf8";
// -->
</script></div>
<syntaxhighlight lang="php">
<div style="clear:both; margin-top:1em; text-align:left;" id="siteNotice"><p>Advertising:</p><div style="border:1px solid black; text-align:center;"><script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script><script type="text/javascript"><!--
google_ad_client = "pub-9543960077946929";
/* none */
google_ad_slot = "5512254708";
google_ad_width = 0;
google_ad_height = 0;
google_language = "zh-tw";
google_encoding = "utf8";
// -->
</script></div>
So this is more than nothing!
As I see you use slot "5512254708" twice!
google_ad_width = 0;
google_ad_height = 0;
OOPS! "width" and "height" set to 0
! :-(
'auto'
for the moment until this is fixed!
I found this information:
It seems, that "responsive" and "auto" are not working with normal ad units. How to deal with "responsive ad units" I have to investigate...
In the case, avoiding 'auto'
for "google_ad_width" and "google_ad_height" don't solve the issues, try WimaAdvertising in Version 2.4.1. You get it here. It should give you this:
<div style="clear:both; margin-top:1em; text-align:left;" id="siteNotice">
Advertising:<div style="border:1px solid black; text-align:center;"><script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script><script type="text/javascript"><!--
google_ad_client = "pub-9543960077946929";
/* none */
google_ad_slot = "5512254708";
google_ad_width = 450;
google_ad_height = 620;
google_language = "zh-tw";
google_encoding = "utf8";
// -->
</script>
<script type="text/javascript" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">
</script></div>
I installed it here:
Try it and give me a report please! --WikiForMen (talk) 22:39, 15 August 2024 (UTC)
I try only put 1 ad in the Sidebar, but Advertising also not show (v2.4.1) source show these:
<div class="after-portlet after-portlet-wimaadvertising-advertising"><script type="text/javascript"><!--
google_ad_client = "ca-pub-9543960077946929";
/* none */
google_ad_slot = "5512254708";
google_ad_width = 120;
google_ad_height = 300;
google_language = "zh-tw";
google_encoding = "utf8";
// -->
</script>
<script type="text/javascript" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">
</script></div>
The source looks good!
I really don't know why nothing is displayed, not even "Advertising":
<div class="vector-menu-heading">
Advertising
</div>
We have not yet tested with MediaWiki 1.43 and especially with Skin Vector (2022). I found the Donate button in the right sidebar. This shows me that our extensions work in principle. You can also see the ad entry in the source code. So I suspect that the Vector skin has some peculiarities in the way it handles sidebars.
Here:
I can see "Advertising" twice in the sidebar. OK, only the label "Advertising" because I have no Google AdSense account, so no Ad is provided, but the source code is inserted and the label visible.
At least the issue with width and height has been resolved:
google_ad_width = 120;
google_ad_height = 300;
Please try:
$wmGoogleAdSense_Bottom = [ 'xxxxx', 1200, 240 ];
Please try also
$wgDefaultSkin = 'vector'; // "Legacy" Vector (2010)
or
$wgDefaultSkin = 'monobook';
Happy testing! ;-)
I have tried vector and monobook, but also not show anything.
I also tried edit size, but not show anything.
(Have closed any extensions. When adblock open, it show page have ad.)
I open the site in the cell phone and ipad, also not show ad.
A look into the HTML code shows, that the extension is working.
You should test, if Google AdSense is well configured:
Please test two simple HTML pages:
<html>
<head
<title>Google AdSense test with js-script-file in the header section</title>
<script type="text/javascript" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">
</script>
</head>
<body>
<h2>This is a Google AdSense test</h2>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-9543960077946929";
/* none */
google_ad_slot = "5512254708";
google_ad_width = 120;
google_ad_height = 300;
google_language = "zh-tw";
google_encoding = "utf8";
// -->
</script>
</body>
</html>
<html>
<head
<title>Google AdSense test with js-script-file NOT in the header section</title>
</script>
</head>
<body>
<h2>This is a Google AdSense test</h2>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-9543960077946929";
/* none */
google_ad_slot = "5512254708";
google_ad_width = 120;
google_ad_height = 300;
google_language = "zh-tw";
google_encoding = "utf8";
// -->
</script>
<script type="text/javascript" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" />
</body>
</html>
I did an online research and found, Google AdSens code has changed. The extension is adapted in version 2.8.2.--WikiForMen (talk) 15:37, 21 August 2024 (UTC)
Can you please share this code? If Google AdSense has changed the code, we are not aware of it.
I only know official js is : https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-number
and single banner code is:
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-number"
crossorigin="anonymous"></script>
<!-- BANNER -->
<ins class="adsbygoogle"
style="display:inline-block;width:120px;height:300px"
data-ad-client="ca-pub-number"
data-ad-slot="5512254708"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
The AdSense code has therefore changed. What is taken into account in WimaAdvertising version 2.8.2. Good luck!
In the source code of your site I can see the following:
<div id="p-wimaadvertising-advertising" class="vector-menu mw-portlet mw-portlet-wimaadvertising-advertising">
<div class="vector-menu-heading">
Advertising
</div>
<div class="vector-menu-content">
<ul class="vector-menu-content-list">
</ul>
<div class="after-portlet after-portlet-wimaadvertising-advertising">
<ins class="adsbygoogle" style="display:inline-block;width:120px;height:300px;" data-ad-client="ca-pub-pub-9543960077946929" data-ad-host="ca-host-pub-" data-ad-slot="5512254708" data-ad-format="vertical"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>
</div>
</div>
</div>
This means that the extension is working.
data-ad-host="ca-host-pub-"
You have obviously not specified the data-ad-host
variable!
As I do not use AdSense myself, I have no idea whether it is necessary to specify these variables. If this is the case, I would have to intercept this special case separately.
Please experiment with the simple HTML file beforehand to separate AdSense configuration issues from MediaWiki or extension issues!!!
The portlet ‘mw-portlet-wimaadvertising-advertising’ is also displayed at the bottom left of the sidebar:
Advertising
This also means that there are no fundamental display issues.
Other reasons could be possible:
Why are Google AdSense ads not showing up properly on my website?
There could be several reasons why Google AdSense ads are not displaying properly on your website:
https://www.quora.com/Why-are-Google-AdSense-ads-not-showing-up-properly-on-my-website
Submit your site for review
https_support.google.com/adsense/answer/12176698?hl=en
We need to make sure that you have correctly configured and activated your Google AdSense account. Therefore, please test this simple HTML file:
<html>
<head>
<meta charset="UTF-8"/>
<title>WimaAdvertising – Test 1</title>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9543960077946929" crossorigin="anonymous"></script>
</head>
<body>
<div style="border:solid green 15px;">
<ins class="adsbygoogle"
style="display:inline-block;width:120px;height:300px;"
data-ad-client="ca-pub-9543960077946929"
data-ad-slot="5512254708"
data-ad-format="vertical"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</body>
</html>
I try it, but it only show a green box. By the why, I also to read google ad offcial code, There is no need for this code:data-ad-host. Now I use other code, it's normal.
I removed data-ad-host in version 2.8.3, but I still can not see any ad on your page...
I'm desperately trying to figure out which AdSense code works. It's certainly not the extension.
It seems runned, ad showed, but not put in sidebar in desktop,mobile sometimes will show. BTW, the google adsense official code style without ";" at the end, like this:
style="display:inline-block;width:120px;height:300px"
and dev tool will show error:
adsbygoogle.js:172 Uncaught TagError: adsbygoogle.push() error: No slot size for availableWidth=0
at qo (adsbygoogle.js:172:327)
at po (adsbygoogle.js:171:147)
at zo (adsbygoogle.js:176:104)
at Fo (adsbygoogle.js:190:29)
at lq (adsbygoogle.js:216:105)
at kq (adsbygoogle.js:215:620)
at uq (adsbygoogle.js:232:173)
at e.client (adsbygoogle.js:224:43)
at $e.ga (adsbygoogle.js:59:239)
at ak (adsbygoogle.js:97:19)
Confusing: "seems runned, ad showed" ... "dev tool will show error" ...
The ";" at the end makes a difference?!?? It should not...
The error show is with or without ";"?
I can remove it, if this causes problems...
What about
?
So I did Version 2.8.3.1 (for testing).
I dont know, I think ";" is needed, but google adsense offcial code without it.
And I know what happened, I opened auto ad, so the ad will also show Anchor ads & In-page formats.
So v2.8.3 can be used normally, thanks for your work and help.
These HTML snippets have the charm of the 1980s, when every HTML page was hand-coded and such snippets were inserted individually.
This is a far cry from today's practice, where HTML pages are generated automatically and the solutions also have to work in a generalised way for many websites. It is a hopeless mess...
The last ";" is optional. In general, the Css stuff should only be interpreted by the reader's browser and not by Google AdSense. But let's leave it at that.
Happy "websiting"! ;-)