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="//"></script>
<ins class="adsbygoogle"
(adsbygoogle = window.adsbygoogle || []).push({});

Go to the White Label settings and place the next part of the code in the Meta tab (select in the Page type item Flights SERP):

<script async='async' src='//'></script>
<style>.adsbygoogle { text-align:center;margin-bottom:20px;display:inline-block}
#ad_top_container { text-align:center;}</style>

Note: The ad_top_container tag is responsible for placing the banner above the search result. If you replace it on ad_bottom_container, the banner will appear below the search results.

Go to the Footer tab and place this code there:

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', '');
js.setAttribute('async', true);
document.head.appendChild(js); setTimeout(function(){
(adsbygoogle = window.adsbygoogle || []).push({});
}, 1000); }, 3000);

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.

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

Tip: To remove an ad from the White Label home page, add a check for the TPWL-widget-front_page class.

<script async='async' src='//'></script>
<style>.adsbygoogle { text-align:center;margin-bottom:20px;display:inline-block}
#ad_top_container { text-align:center;}
.TPWL-widget--front_page #ad_top_container { display:none;}