How to add Google AdSense to White Label

This article describes how to place Google AdSense code in White Label flight search results.

Open your AdSense account and create an ad.

You’ll get a code like:

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-0515363181603345"
data-ad-slot="8813803962"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

Go to the White Label settings and place the following code in the Metadata section (select the Avia result page tab):

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=GOOGLE-DATA-AD-CLIENT"
crossorigin="anonymous"></script>
<ins class="adsbygoogle"
style="display:block; text-align: center;"
data-ad-client="GOOGLE-DATA-AD-CLIENT"
data-ad-slot="GOOGLE-DATA-AD-SLOT"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

Replace GOOGLE-DATA-AD-CLIENT on the value of the data-ad-client attribute, and GOOGLE-DATA-AD-SLOT on the value of the data-ad-slot attribute from your ad code.

Go to the Sections tab and place this code into the Site footer block (before the last </div>):

<script>
setTimeout(function(){ var div = document.createElement("ins");
div.setAttribute('class', 'adsbygoogle');
div.setAttribute('data-ad-client', 'GOOGLE-DATA-AD-CLIENT');
div.setAttribute('data-ad-slot', 'GOOGLE-DATA-AD-SLOT'); document.getElementById('ad_top_container').appendChild(div); var js = document.createElement("script");
js.setAttribute('src', 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js');
js.setAttribute('async', '');
document.head.appendChild(js); setTimeout(function(){
(adsbygoogle = window.adsbygoogle || []).push({});
}, 1000); }, 3000);
</script>

Save the changes. Now the Google AdSense ad will appear in the search results.