Message-ID: <835180424.10579.1711612815810.JavaMail.confluence@docs1> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_10578_801019342.1711612815810" ------=_Part_10578_801019342.1711612815810 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Google AdSense and other ads services like AdSense don't work we= ll on a full ajax mode site. So, from 4.4.0 and up, we make a new setting t= hat allows you turn off full ajax mode. Please turn off full ajax mode if t= his tutorial doesn't work on your site.
As an Admin you can create HTML based ads directly from your AdminCP by = creating a new bloc= k, choosing HTML as the block type. This is what we will use for our Go= ogle ads.
When making your ad at Google, please be sure your code is async.
Original ads code from Google which you can use on your block, with ajax mode dis= abled, in v4.4 and above:
<script as= ync src=3D"//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"><= ;/script> <!-- myad --> <ins class=3D"adsbygoogle" style=3D"display:block" data-ad-client=3D"mypub" data-ad-slot=3D"myadslot" data-ad-format=3D"auto"></ins> <script> (adsbygoogle =3D window.adsbygoogle || []).push({}); </script>=20
In order for the ad to display properly in versions below v4.4= strong>, we need to add the $Behavior function as shown below in the last &= lt;script> tag.
New code:
<script as= ync src=3D"//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"><= ;/script> <!-- myad --> <ins class=3D"adsbygoogle" style=3D"display:block" data-ad-client=3D"mypub" data-ad-slot=3D"myadslot" data-ad-format=3D"auto"></ins> <script> $Behavior.googleads =3D function(){ (adsbygoogle =3D window.adsbygoogle || []).push({}); }; </script>=20
Place the HTML code in the code input area for the new block and set the= location (where on the page you want it) and controller (which page should= it show on). For our screenshot below of a Google ad, we chose Sitewide as= the controller as we want it all over the site.
Note for versions below v4.4: If you create more than 1 ads unit, please= change "google ads" (in $Behavior.googleads), because this is unique&= nbsp;text.