Extension talk:Google AdSense/Archive 2/Flow export
Add topic| This page used the Structured Discussions extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
How to make GoogleAdsense 2 display ads on content pages only
[edit]Thanks for the Google AdSense 2 extension, it works great! However, I have a question you may have an answer to:
I would like ads to be shown only on pages in the NS_MAIN namespace. Can this be done in GoogleAdSense.php or in LocalSettings.php? If so, how?
According to Google's current AdSense Terms and Conditions ads should not display on non-content pages, which does not necessarily include various system or even search pages etc. If they are, the publisher may risk having their account terminated.... I guess this was something that Google introduced after you originally wrote the extension.
Thanks in advance for any advise! 87.163.99.34 16:47, 28 August 2012 (UTC)
- There are no limitation options in the extension at the moment. What you can do is use robots.txt to block them from spidering parts of your wiki, and consequently, no ads will be placed on pages where the spider is blocked.
- Alternatively, you can consider creating a patch that will only add the portlet on pages in $wgContentNamespaces. siebrand (talk) 20:59, 28 August 2012 (UTC)
- Thanks for the tips. However, modifying robots.txt for this particular purpose alone sounds to me a less than an ideal solution. I'm not quire sure how to create a patch. However, adding the following in GoogleAdSense.class.php this seems to do the trick:
- 87.163.106.94 22:42, 29 August 2012 (UTC)
global $wgTitle; if ($wgTitle->getNamespace() != 0) { return $bar; }- Does anyone know what the best way to achieve this would be now that $wgTitle has been deprecated in 1.19? 75.68.197.26 02:49, 23 October 2012 (UTC)
- I was able to use the following in GoogleAdSense.class.php to replace $wgTitle:
// Keeps blank pages from showing AdSenseif ( $skin->getTitle()->getNamespace() != 0) {return $bar;}- I hope that helps. Floydlawson (talk) 00:00, 26 December 2012 (UTC)
- HELP!! I do not know where to enter these codes. I have tried BOTH of them. Am I entering them in the wrong location in the GoogleAdsense.class.php file?! I am STILL getting ads on non content pages. What a dumb extension. It should ALREADY be able to display ads on the main article pages. Instead, it displays ads on ALL of them. This includes talk pages and history pages. In Correct (talk) 15:54, 5 March 2013 (UTC)
- I read about this function and I think it could imput the Adsense in the body of the article.
- =========================
</code> <?php $wgExtensionFunctions[] = "wfassExtension"; function wfassExtension() { global $wgParser; $wgParser->setHook( "adsensesearch", "renderass" ); } function renderass( $input, $argv ) { $output = ' <script type=\"text/javascript\"><!-- google_ad_client = \"xxxxxxxxxxxxxx\"; google_ad_width = 728; google_ad_height = 90; google_ad_format = \"728x90_as\"; google_ad_type = \"text_image\"; google_ad_channel =\"\"; google_color_border = \"F7DBBC\"; google_color_bg = \"F7DBBC\"; google_color_link = \"60442D\"; google_color_url = \"60442D\"; google_color_text = \"60442D\"; //--></script> <script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"> </script> '; return $output; } ?>- Anyone has any idea how to improve it? Zimbres (talk) 22:14, 3 June 2013 (UTC)
- HELP!! I do not know where to enter these codes. I have tried BOTH of them. Am I entering them in the wrong location in the GoogleAdsense.class.php file?! I am STILL getting ads on non content pages. What a dumb extension. It should ALREADY be able to display ads on the main article pages. Instead, it displays ads on ALL of them. This includes talk pages and history pages. In Correct (talk) 15:54, 5 March 2013 (UTC)
- Does anyone know what the best way to achieve this would be now that $wgTitle has been deprecated in 1.19? 75.68.197.26 02:49, 23 October 2012 (UTC)
Please for some advice.
[edit]Hi,
please, can you clarify the meaning of the options?
In the Google AdSense panel the ID Publisher is what you call $wgGoogleAdSenseClient and the ID is what you call $wgGoogleAdSenseSlot. So, what is $wgGoogleAdSenseID?
This is my Google code:
<script type="text/javascript"><!--
google_ad_client = "ca-pub-1234567890123456";
/* C-Wiki Box 120x240 */
google_ad_slot = "3350532419";
google_ad_width = 120;
google_ad_height = 240;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
There are some examples somewhere?
I don't undestand what I have to write in $wgGoogleAdSenseSrc.
I wish also a banner in sitenotice. What I have to do?
Furthermore I wish to remove the title "Google AdSense" in the Sidebar and to show the banner always, now it is collassable.
This is the link to my Wiki.
Thanks in advance. WhiteTigerItaly (talk) 10:20, 30 September 2012 (UTC)
- Greetings,
- I'm not a user of this extension nor I'm a user of Google Ads. I've checked the code of the extension, and this is what it outputs:
</code>
<script type=\"text/javascript\"><!--
google_ad_client = \"$wgGoogleAdSenseClient\";
/* $wgGoogleAdSenseID */
google_ad_slot = \"$wgGoogleAdSenseSlot\";
google_ad_width = " . intval( $wgGoogleAdSenseWidth ) . ";
google_ad_height = " . intval( $wgGoogleAdSenseHeight ) . ";
// -->
</script>
<script type=\"text/javascript\"
src=\"$wgGoogleAdSenseSrc\">
</script>
- $wgGoogleAdSenseSrc is the src="xxx". As for $wgGoogleAdSenseID, I'm not entirely sure. I think "C-Wiki Box 120x240"? Fereal (talk) 11:01, 30 September 2012 (UTC)
- Yes, I think that you're right. Your output is equal to my Google code and in this Google identifies Slot what that in the its panel names ID.
- There is a little confusion around all.
- However:
- Client is the Publisher ID;
- Slot is ID (in the Google panel) or Slot (in the Google code)
- ID is the name that a Google user has assigned to his AdSense module.
- In my case, your're right: it is "C-Wiki Box 120x240".
- But however I don't understand why it is need. The module is identified from the Google ID/Slot (the number) and also in the Google code the name of the module is only a comment.
- Thanks. WhiteTigerItaly (talk) 13:33, 30 September 2012 (UTC)
More than one ad at once
[edit]I really like this extension, it does the job very well. However, on my site it seems that there is always only one ad in the box, centered. I would much prefer two, like the screenshot depicts. Is anyone able to display more than one ad at once?
Thanks, Craig131 (talk) 07:58, 5 October 2012 (UTC)
Ridrect pages and short pages
[edit]Hi, one of my websites has just been disabled by AdSense, although they did not disabled by account. The problem was caused by a redirect page which they say "has no contents" and is against the AdSense policy. Also, I am worried that some of my pages are too short because some pages take time to grow. Is there any way out of this problem? PM Poon (talk) 19:55, 13 November 2012 (UTC)
Page not found in google AdSense box
[edit]
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Hi, I have installed the extension on a wiki. My AdSense is new, so it is under review.
The problem: in firefox I see the empty box, as expected.
In internet explorer, or opera, I have an error message in the box.
What kind of problem can this be?
Mediawiki is version 1.19.3
PHP is: 5.2.6-1+lenny9 (apache2filter)
Page with all versions is here: http://www.vafud.com/wiki/Speciale:Versione
Any suggestion? 87.12.108.30 00:05, 7 December 2012 (UTC)
- Never mind. After few hours it started working. Probably because it was a new adsense item.
- If you wish delete this discussion, or leave it for knowledge. 87.12.108.30 09:13, 7 December 2012 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.
Have AdSense Toolbox constantly open.
[edit]Hello, I'm running a mediawiki site on version 1.20.2. When I installed the plugin, it displayed ads correctly and neatly, however it stored them into a closable and openable section in the Sidebar. Is it possible at all to have this always open? Or make it only always open for a certain group of users? Does the fact that it's open affect the revenue generated? Any help would be appreciated, thanks. Anoadragon453 (talk) 23:35, 16 February 2013 (UTC)
- We need help! :) 2003:5F:2707:7401:3826:922F:BC56:E9FC 17:14, 27 May 2013 (UTC)
- Ading this to MediaWiki:Vector.css seems to give the ads section open
/* force the display of the contents of the section */
#p-googleadsense .body {
display:block !important;
}
/* Option 1: hide the header */
#p-googleadsense h3 {
display:block;
}
/* Option 2: just hide the arrow in the header */
#p-googleadsense h3 {
background:none !important;
}
151.40.203.33 21:52, 20 December 2013 (UTC)
- Can you be a bit more specific about how to make this change? I've tried adding the code to the bottom of my ./wiki/resources/mediawiki.ui/mediawiki.ui.vector.css file, but it doesn't seem to help. Is this the correct file and path?
- Thanks! TheAlmightyGuru (talk) 15:45, 2 June 2014 (UTC)
- Thanks mate that really helped me.
- @TheAlmightyGHure
- Go to "MediaWiki:Vector.css" in your wiki and add it there. You don't need to add or edit a file, but edit a wiki page. Think of it as a template 84.24.79.254 22:18, 24 January 2015 (UTC)
- Thanks for the info, that did work! TheAlmightyGuru (talk) 19:01, 26 January 2015 (UTC)
Maximum Skyscraper Ad Width?!
[edit]Ads are successfully being displayed on the MediaWiki portion of my website. I am viewing it with MonoBook skin and the Vertical Ad is cut off! Why is it cutting off part of the ad?! In Correct (talk) 16:11, 5 March 2013 (UTC)
This extension got my adsense account disabled
[edit]- I have no idea what I did wrong other than use this extension. Hopefully future versions of this extension will adhere to the Google Adsense ToS so this doesn't happen to anyone else. Jeff 15:58, 2 April 2013 (UTC)
- Did you click on the ads yourself? That seems to be the reason for a lot of suspensions. Gboyers (talk) 16:11, 2 April 2013 (UTC)
- As indicated by a discussion on the Google Product forums, the extension shipped with code that's against Google's policies by default. Maybe that was why. James Martindale (talk) 20:26, 23 October 2016 (UTC)
Why won't it accept the full ad client?
[edit]My ad client comes up starting with:
(code sample below)
<script type="text/javascript"><!--
google_ad_client = "ca-pub-878062......";
..
..
..
..
</script>
However this extension doesn't like the ca in front, and I had to delete that. Perhaps this extension should have a case where it can take the ca in with no problem. Bluesoju (talk) 14:36, 15 April 2013 (UTC)
Ads not showing
[edit]- I believe I have set this up correctly however the ads are not showing on the site - In google chrome I only see the "google adsense" header and in internet explorer I see an error 400
- My account has just been approved so the code must be there - My Local settings is as follows - Last 2 numbers of each number removed on here
#Google Adsense
require_once( "$IP/extensions/GoogleAdSense/GoogleAdSense.php" );
$wgGoogleAdSenseClient = 'pub-99264879323815xx';
$wgGoogleAdSenseSlot = 'WikiSidebar';
$wgGoogleAdSenseID = '69837836xx';
- Is the problem here?
- Lordmwa (talk) 07:03, 1 June 2013 (UTC)
- You must write like this:
- $wgGoogleAdSenseSlot = '69837836xx';
- $wgGoogleAdSenseID = 'WikiSidebar'; 85.237.37.175 12:36, 31 August 2014 (UTC)
- google adsense shwoing 400() error in consolen window 103.251.48.13 (talk) 09:36, 10 October 2017 (UTC)
- . Itwan (talk) 12:34, 12 October 2019 (UTC)
Imput adsense in an article
[edit]I saw this function on the Internet and I think it is a way to imput adsense in the body of an article. Does anyone has any idea how to improve it?
<?php
$wgExtensionFunctions[] = "wfassExtension";
function wfassExtension() {
global $wgParser;
$wgParser->setHook( "adsensesearch", "renderass" );
}
function renderass( $input, $argv ) {
$output = '
<script type=\"text/javascript\"><!--
google_ad_client = \"pub-xxxxxxxxxxxxx\";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = \"728x90_as\";
google_ad_type = \"text_image\";
google_ad_channel =\"\";
google_color_border = \"F7DBBC\";
google_color_bg = \"F7DBBC\";
google_color_link = \"60442D\";
google_color_url = \"60442D\";
google_color_text = \"60442D\";
//--></script>
<script type=\"text/javascript\"
src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">
</script>
';
return $output;
}
?>
Zimbres (talk) 22:22, 3 June 2013 (UTC)
Nothing appears
[edit]Install the plugin, changed the parameters to my designed advert and nothing appears on the wiki?
What steps am i missing?
Do I need to put specific code into my sidebar? DG 21:53, 1 August 2013 (UTC)
Problem with display
[edit]I see this in console:
Refused to display 'https://googleads.g.doubleclick.net/pagead/...' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
Doing a little research I see:
http://stackoverflow.com/questions/20498831/refused-to-display-in-a-frame-because-it-set-x-frame-options-to-sameorigin
Broken code?
Any ideas? SirLouen (talk) 20:53, 5 July 2014 (UTC)
Require Once statement
[edit]
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
What file do I want to require_once? Tahongawaka (talk) 19:01, 28 October 2014 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.
Google AdSense doesn't shows
[edit]My page is:http://wiki.westeros.pl/
I installed this extesnion and added this code to LocalSettings.php:
#GoogleAdSense
require_once "$IP/extensions/GoogleAdSense/GoogleAdSense.php";
$wgGoogleAdSenseClient = 'ca-pub-373458718679XXXX';
$wgGoogleAdSenseSlot = '8263716XXX';
$wgGoogleAdSenseID = 'Wiki Westeros 2';
// Width of the AdSense box, specified in your AdSense account
$wgGoogleAdSenseWidth = 120;
// Height of the AdSense box, specified in your AdSense account
$wgGoogleAdSenseHeight = 240;
// Source URL of the AdSense script
$wgGoogleAdSenseSrc = "http://pagead2.googlesyndication.com/pagead/show_ads.js";
// Show the AdSense box only for anonymous users
#$wgGoogleAdSenseAnonOnly = true;
#$wgGoogleAdSenseClient = 'replace this with the client name';
#$wgGoogleAdSenseSlot = 'replace this with the slot name';
#$wgGoogleAdSenseID = 'replace this with your ID';
But GoogleAdsense still doesn't show on my page. TraaBBIT (talk) 04:17, 15 July 2015 (UTC)
Change Portlet Label
[edit]To comply with Google's usage requirements, you need to change the portlet's label from "google adsense" to "Advertisements". A discussion of the issue, with two simple line changes, can be found on the google forums.
See: Mediawiki Extension:Google AdSense Sakshale (talk) 16:17, 15 August 2015 (UTC)
Responsive ads
[edit]Anyone tried this extension with the responsive ad type? Icerat (talk) 18:48, 31 August 2015 (UTC)
Ad loading below page in 1.26
[edit]Just a report that the extension is sometimes loading the Ad below all the other page content in MediaWiki 1.26.2. If anyone has any idea why this might be, I would greatly appreciate the help! As far as I can analyze, I don't see a reason for this to suddenly have started occurring. Dkpat (talk) 21:56, 20 January 2016 (UTC)
Unmaintained but another option:
[edit]I searched high and low for an extension that worked for MW 1.33 a while back but couldn't find one. Finally landed on using hooks instead. Putting this in LocalSetting.php appears to work for first approval or-auto ads:
# Assign my functions to hook
$wgHooks['BeforePageDisplay'][] ='onBeforePageDisplay';
function onBeforePageDisplay( OutputPage &$out, Skin &$skin )
{
$script = '<script data-ad-client="ca-pub-XXXXXXXXXXXXXXXX" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>';
$out->addHeadItem("wowhead script", $script);
return true;
}; TiltedCerebellum (talk) 06:34, 9 December 2019 (UTC)
- how is it working?
- Does it only put ads on the sidebar, like the extension is supposed to? Vapblack (talk) 11:43, 7 October 2020 (UTC)
- The extension? I'm not sure anymore, I stopped using it. When I used it, it worked fine though. The code sample above was just adding the code to the header to get Google ads to recognize the code on the site and to get approval. After that we placed code in different places to achieve what we were after.
- We additionally placed ads in the wiki site notice using a widget, then at the footer of each page using a hook, described in this:
- https://www.mediawiki.org/w/index.php?title=Extension%20talk%3AGoogle%20AdSense/Archive%202/Flow%20export#c-TiltedCerebellum-2020-08-29T18%3A13%3A00.000Z-2001%3A8F8%3A1E23%3ADE9%3A28%3AC70%3A94FF%3AF3EF-2020-08-17T05%3A34%3A00.000Z TiltedCerebellum (talk) 16:49, 8 October 2020 (UTC)
Position in MediaWiki:Sidebar
[edit]Hi there,
how can I Change the Position in the MediaWiki:Sidebar. I would like to have the ads on top of my sidebar.
I tried some stuff like:
* googleadsense
* googleadsense-portletlabel
* Advertisements
I can't figure out how I can change it... with googleadsense-portletlabel I saw my changed Text "Sponsored Link"
Someone can help me with that?
cheers
Andreas
37.209.65.246 (talk) 19:27, 19 January 2020 (UTC)
- The extension is meant to insert it in a specific place, if you don't want to do that you might try using a hook instead of the extension. Manual:Hooks/SidebarBeforeOutput TiltedCerebellum (talk) 18:32, 29 August 2020 (UTC)
Google keeps rejecting my site
[edit]Is there something specific I should be doing?
I know I should be probably adding more info, but I don't know what. Vapblack (talk) 16:00, 2 February 2020 (UTC)
- That's what the extension page is for, to tell you how to use it. If something isn't working you need to be specific about what when you write on an extension's page or the extension maker can't help.
- Extension:Google AdSense TiltedCerebellum (talk) 18:28, 29 August 2020 (UTC)
Async
[edit]Hi,
The script should call the ad script asynchronously, per google recommendation:
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" style="display:inline-block;width:120px;height:240px" data-ad-client=" " data-ad-slot=" "></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
2601:86:300:A8BF:F942:3A0:1B72:CD9 (talk) 18:28, 30 April 2020 (UTC)
Anyone else getting Error500?
[edit]Anyone else getting Error 500? tried everything available in this site. 185.209.178.78 (talk) 19:30, 31 May 2020 (UTC)
- I do. As soon as I enable line to load extension. 87.116.190.6 (talk) 18:15, 4 June 2020 (UTC)
- Are you making sure to use the correct extension version for your MW version? TiltedCerebellum (talk) 18:26, 29 August 2020 (UTC)
what it the main concept of side bar ad.
[edit]what about having this extension to be extended more, there is no point of having a small add displayed at side bar, people wanted an extension to generate some income in order to cover running cost, having one tiny small ad displayed at side bar will bring no value, in addition, you are only adding more page load time by loading google stuff for one ad!!!!!
still i can see many wikis running ads, and their Ads are showing on top, bottom, and even in article it self, the question here, why there is no explanation about this, how to do it and get it done in a proper way.
if you googled wordpress adsense plugin, you will get tons of them, i'm not comparing wordpress with mediawiki, but both of them are php, but they know how to market them self, and get more people on board. 2001:8F8:1E23:DE9:28:C70:94FF:F3EF (talk) 05:34, 17 August 2020 (UTC)
- In-page Google Adsense (GA) auto-ads probably work just fine, or they may be embedding them manually from manually created ads, that's what we initially did. After initial activation, for manual ads, adsense code can be added to a Widget which allows code to be inserted into a wiki, then the widget embedded in the site notice for example. Though an easier way is to enable the code in the site's header via a hook, then to turn on and configure auto-ads. If people want precise locations, then they are looking at cobbling together hooks and/or extensions (I assume this is what the extension is for because getting sidebar stuff to show up can be tricky) or editing skin files. Though skin file edits will be wiped out when the skin is updated which is not ideal, so keeping a copy of the edited file for reference is a good idea.
- Since different skins use different code (made by different people and not by the makers of MediaWiki), they probably can't make a universal extension that just "works" out of the box for everywhere, the code is too different from skin to skin for some things. It is what it is.
- For auto-ads or initial GA approval where they ask you to put code in your site's header, the following hook can be put in the LocalSettings.php (with the appropriate parts changed):
# Assign my functions to hook
$wgHooks['BeforePageDisplay'][] ='onBeforePageDisplay';
function onBeforePageDisplay( OutputPage &$out, Skin &$skin )
{
$script = '<script data-ad-client="ca-pub-XXXXXXXXXXXXXXXX" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>';
$out->addHeadItem("wowhead script", $script);
return true;
};
- Lots of people use hooks to get ads where they want, the sidebar is the trickier part sometimes when it refuses to show.
- This is an example of a footer hook used to insert a controlled-size (manually created) ad (though it could be rewritten to show an responsive or automatically resizing manual ad if someone doesn't want to use auto-ads):
$wgHooks['SkinAfterContent'][] = function(&$data, $skin) {
$data = '<div class="gas-bottom">';
$data .= '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>';
$data .= '<ins class="adsbygoogle gas-bottom-first"
style="display:table; width:728px; height:90px; margin:1em auto; clear:both;"
data-ad-client="ca-pub-XXXXXXXXXXXXXXXX"
data-ad-slot="XXXXXXXXXX"></ins>';
$data .= '<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>';
$data .= '</div>';
return true;
};
## -- Adsense footer end -- ##
We extend through hooks, which are used to write extensions, or to write small bits of code yourself to extend MediaWiki functionality. TiltedCerebellum (talk) 18:13, 29 August 2020 (UTC)
Undefined variable: GoogleAdSenseLang in GoogleAdSense.class.php
[edit]
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
I just upgraded to MediaWiki 1.35 and updated the Google AdSense to 1.35, but I keep getting this error multiple times, along with undefined variable for GoogleAdSenseEncoding.
I load the extension with the following code:
wfLoadExtension( 'GoogleAdSense' );
$wgGoogleAdSenseClient = 'pub-5737815xxxxxxxxx';
$wgGoogleAdSenseSlot = '1234xxxxxx';
$wgGoogleAdSenseID = 'myIdName';
$wgGoogleAdSenseWidth = 120;
$wgGoogleAdSenseHeight = 600;
$wgGoogleAdSenseSrc = '//pagead2.googlesyndication.com/pagead/show_ads.js';
$wgGoogleAdSenseAnonOnly = true;
I've tried setting values for the undefined variables in my LocalSettings.php, but it doesn't help. Any idea s? TheAlmightyGuru (talk) 13:59, 9 December 2020 (UTC)
- It is a bug! See here. This variables are misspelled on line 41-42 in file GoogleAdSense.class.php. --WikiForMen (talk) 05:43, 7 January 2021 (UTC)
- Thank you. I fixed the incorrect variable names, but I'm still not seeing the ads. I've changed the extension's status to unstable. Hopefully, someone will fix the bugs. TheAlmightyGuru (talk) 21:20, 19 January 2021 (UTC)
- Try Version 2.2b from extension WimaAdvertising. Should do the same but with better css integration in the sidebar and you can two ad units, additionally define its position in the MediaWiki:Sidebar file. --WikiForMen (talk) 02:54, 20 January 2021 (UTC)
- Problem is fixed!--WikiForMen (talk) 16:13, 8 February 2021 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.
Can't get Adsense Extension to work.
[edit]
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
- I can not get this to work at all. Brand new install of 1.35.
- The Version page shows the extension installed and working. Here are my entries in the LocalSettings.php file:
- $wgGoogleAdSenseClient = "ca-pub-xxxxxxxxxxxxxxxxxxxxx";
- $wgGoogleAdSenseSlot = 'WikiSidebar';
- $wgGoogleAdSenseWidth = 120;
- $wgGoogleAdSenseHeight = 240;
- $wgGoogleAdSenseSrc = '//pagead2.googlesyndication.com/pagead/show_ads.js';
- $wgGoogleAdSenseID = 'none';
- $wgGoogleAdSenseEncoding = "utf8";
- $wgGoogleAdSenseLang = "en";
- Absolutely nothing happens. I've tried the different skins installed and nothing shows up, not even the 'Adsense' title in the side bar.
- Any help would be greatly appreciated. Gomez Adams 67 (talk) 16:55, 17 May 2021 (UTC)
- May be you configured your browser to block ads?!?? In this case absolutely nothing will happen. ;-) --WikiForMen (talk) 21:06, 17 May 2021 (UTC)
- Have a try: Extension:WimaAdvertising --WikiForMen (talk) 19:00, 17 May 2021 (UTC)
- Of course my browser isn't set to block ads.
- I tried your WimaAdvertising plugin and it works for top and bottom but not the sidebar. Is there any way to get rid of the "advertising" word and the black box outline? I'd rather just have the ads there without that.
- Thanks! Gomez Adams 67 (talk) 13:25, 18 May 2021 (UTC)
- Using WimaAdvertising you should add AD1 into the MediaWiki:Sidebar! Please read the "Use" part! You can set your own CSS style specifications at
$wgBannerTopStyle. --WikiForMen (talk) 11:09, 19 May 2021 (UTC)
- Thanks! I'm new to this and learning as I go. That did the trick! Gomez Adams 67 (talk) 12:37, 19 May 2021 (UTC)
- No problem! Enjoy! --WikiForMen (talk) 18:08, 19 May 2021 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.
Extension does not work on MediaWiki 1.37.
[edit]I have a Mediawiki website, version 1.37, with the Timeless skin. I installed the Google Adsense extension yesterday and it appears listed as it should in Special:Version.
In the LocalSettings.php file I have added the following lines of code:
wfLoadExtension( 'GoogleAdSense' );
$wgGoogleAdSenseClient = 'ca-pub-xxxxxxxxxxxxxxxx';
$wgGoogleAdSenseSlot = 'xxxxxxxxxx';
$wgGoogleAdSenseSrc = '//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-xxxxxxxxxxxxxxxx';
When I check the code of different Mediawiki's pages I don't see any Adsense code added, so obviously the extension does not work. Have I done something wrong or does the extension have an issue? Costas Athan (talk) 08:57, 6 December 2021 (UTC)
- Due to changes in REL1_39 injecting HTML with the
SkinBuildSidebar hook is no longer supported. Because the SkinAfterPortlet hook is already available from REL1_35, it is possible that Skin Timeless no longer supported it before REL1_39.
- Extension:WimaAdvertising should do the job now! --WikiForMen (talk) 12:12, 28 October 2023 (UTC)
- Thanks for the info. I will give it a try. Costas Athan (talk) 18:03, 2 December 2023 (UTC)
- Good luck. I haven't explicitly tested it with the Timeless skin. So I would be happy about a report. But using Hook SkinAfterPortlet, it should do the job.
- After a test, I came to the conclusion that skin Timeless may not support hook SkinAfterPortlet. WikiForMen (talk) 18:22, 2 December 2023 (UTC)
Incompatibility
[edit]This extention use hook SkinBuildSidebar to inject HTML into the sidebar.
- "As of MediaWiki 1.39, injecting HTML is no longer supported with this hook. If you are looking to inject HTML, such as to put an ad in the sidebar, you must use Manual:Hooks/SkinAfterPortlet or similar."
The extentions has to be rewritten to support actual versions of mediawiki. WikiForMen (talk) 21:41, 22 December 2023 (UTC)