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.