Topic on Extension talk:Google AdSense/Archive 2

Undefined variable: GoogleAdSenseLang in GoogleAdSense.class.php

5
Summary by WikiForMen

Problem solved!

TheAlmightyGuru (talkcontribs)

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?

WikiForMen (talkcontribs)

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)

TheAlmightyGuru (talkcontribs)

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.

WikiForMen (talkcontribs)

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)

WikiForMen (talkcontribs)