Hello,
i have this AdSense code
<script type=”text/javascript”><!–
google_ad_client = “ca-pub-1234567890123456”;
/* Citypatras.gr / 336×280 */
google_ad_slot = “1234567890/1234567890″;
google_ad_width = 336;
google_ad_height = 280;
//–>
</script>
<script type=”text/javascript”
src=”//pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>
But the Custom ad print this without adslot:
<script type=”text/rocketscript”>
var td_screen_width = document.body.clientWidth;
if ( td_screen_width >= 1200 ) {
/* large monitors */
document.write(‘<ins class=”adsbygoogle” style=”display:inline-block;width:300px;height:600px” data-ad-client=”ca-pub-1234567890123456″ data-ad-slot=””></ins>’);
(adsbygoogle = window.adsbygoogle || []).push({});
}
if ( td_screen_width >= 1019 && td_screen_width < 1200 ) {
/* landscape tablets */
document.write(‘<ins class=”adsbygoogle” style=”display:inline-block;width:300px;height:600px” data-ad-client=”ca-pub-1234567890123456″ data-ad-slot=””></ins>’);
(adsbygoogle = window.adsbygoogle || []).push({});
}
if ( td_screen_width >= 768 && td_screen_width < 1019 ) {
/* portrait tablets */
document.write(‘<ins class=”adsbygoogle” style=”display:inline-block;width:300px;height:600px” data-ad-client=”ca-pub-1234567890123456″ data-ad-slot=””></ins>’);
(adsbygoogle = window.adsbygoogle || []).push({});
}
if ( td_screen_width < 768 ) {
/* Phones */
document.write(‘<ins class=”adsbygoogle” style=”display:inline-block;width:300px;height:600px” data-ad-client=”ca-pub-1234567890123456″ data-ad-slot=””></ins>’);
(adsbygoogle = window.adsbygoogle || []).push({});
}
</script>
data-ad-slot is empty.
Can you fix it?
Thanks a lot!
Hi,
I understand. Have you tried using it just like this: google_ad_slot = "1234567890";?
You can find it here: http://screencast.com/t/7SlL7upl
Thanks
Hello,
the two numbers is differents.
i make change on pattern and now it’s ok.
preg_match(‘/”([a-zA-Z0-9\s]+)”/’, $explode_ad_code[1], $matches_add_slot)
to
preg_match(‘/”([a-zA-Z0-9\/\s]+)”/’, $explode_ad_code[1], $matches_add_slot);
Now include the symbol “/”.
Thanks a lot!