Jump to content

Topic on Extension talk:WimaAdvertising

Not Show any ad in vector

26
Tunglinwu (talkcontribs)

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.

WikiForMen (talkcontribs)

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.

view-source:https://41.wikimannia.org/index.php?title=Zollunion_des_S%C3%BCdlichen_Afrika

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)

WikiForMen (talkcontribs)

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)

Tunglinwu (talkcontribs)

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.

WikiForMen (talkcontribs)

"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:

view-source:https://41.wikimannia.org/index.php?title=Zollunion_des_S%C3%BCdlichen_Afrika

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)

Tunglinwu (talkcontribs)

like this:

mystie

I set 4, but source only show 1.

If top show "Advertising:"(text) and replace my sitenotice, and no any ad.

WikiForMen (talkcontribs)

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! :-(

Do not use 'auto' for the moment until this is fixed!

I found this information:

Especially with responsive themes you would need responsive ad units, because the normal ad sizes are not checking if they fit into your theme.
Source: https://webgilde.com/en/adsense-auto-resizing-error/

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:

view-source:https://42.wikimannia.org/index.php?title=Spezial:Version

Try it and give me a report please! --WikiForMen (talk) 22:39, 15 August 2024 (UTC)

Tunglinwu (talkcontribs)

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>
WikiForMen (talkcontribs)

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:

https://42.wikimannia.org/index.php?title=MediaWiki:Sidebar

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.

By the way: Have you installed an AdBlocker? That would explain why the source code is available but nothing is displayed ;-)

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! ;-)

Tunglinwu (talkcontribs)

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.

WikiForMen (talkcontribs)

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>
Tunglinwu (talkcontribs)

Also not show ad, i use other code can show ad.

WikiForMen (talkcontribs)

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)

WikiForMen (talkcontribs)

Can you please share this code? If Google AdSense has changed the code, we are not aware of it.

Tunglinwu (talkcontribs)

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>
WikiForMen (talkcontribs)

The AdSense code has therefore changed. What is taken into account in WimaAdvertising version 2.8.2. Good luck!

Tunglinwu (talkcontribs)

I have update to v2.8.2, also not show.

WikiForMen (talkcontribs)

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:

1> Incorrect Ad Code Implementation: Make sure you have implemented the AdSense ad code correctly on your website. Double-check that you’ve copied and pasted the code provided by AdSense without any errors.
2> Ad Placement Violations: Google has strict policies regarding ad placement. Ensure that you’re not violating any of their policies by placing ads too close to certain content, such as adult content or copyrighted material.
3> Ad Blocking Software: Some visitors might be using ad-blocking software, which prevents AdSense ads from displaying on your website. Unfortunately, this is something beyond your control.
4> Not Enough Content: AdSense requires a sufficient amount of content on your website to serve relevant ads. If your website has very little content or low-quality content, AdSense might struggle to find suitable ads to display.
5> AdSense Account Issues: Check if your AdSense account is active and in good standing. Sometimes, AdSense accounts get suspended or disabled due to policy violations or other reasons, which would prevent ads from displaying.
6> Technical Issues: There could be technical issues with your website or with Google’s ad serving system. Check for any errors in your website’s code or server configuration that might be preventing the ads from loading.
7> Geographical Restrictions: Certain ads might be geo-targeted, meaning they are only displayed to visitors from specific countries. If your website receives traffic from countries where certain ads are not available, those ads might not display.
8> Low Traffic: If your website has very low traffic, AdSense might not be able to find relevant ads to display. Increasing your website’s traffic could potentially improve ad visibility.
If you’ve checked all these points and are still experiencing issues, you might want to reach out to Google AdSense support for further assistance.

https://www.quora.com/Why-are-Google-AdSense-ads-not-showing-up-properly-on-my-website



Submit your site for review

Building a high-quality site takes effort and time. When you’ve addressed the above points, submit your site for review through the Sites page in your AdSense account.
Sign in to your AdSense account.
Click Sites.
In the list of sites, click the site that needs review.
Confirm you've placed the AdSense code on your site. Learn more about pasting ad code in our code implementation guide.
Click Next.
Click Request review.
The review process usually takes a few days, but in some cases can take 2-4 weeks. We'll let you know when we've completed the checks and your site is ready to show ads.

https_support.google.com/adsense/answer/12176698?hl=en

WikiForMen (talkcontribs)

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>
Tunglinwu (talkcontribs)

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.

WikiForMen (talkcontribs)

I removed data-ad-host in version 2.8.3, but I still can not see any ad on your page...

WikiForMen (talkcontribs)

I'm desperately trying to figure out which AdSense code works. It's certainly not the extension.

Tunglinwu (talkcontribs)

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)
WikiForMen (talkcontribs)

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

data-ad-format="vertical"

?

So I did Version 2.8.3.1 (for testing).

Tunglinwu (talkcontribs)

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.

WikiForMen (talkcontribs)

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"! ;-)

Reply to "Not Show any ad in vector"