Implementing new mobile ad unit

Posted in: Newspaper
Post count: 226

Hi guys,
I got a mail from Google adsence optimization team asking me to implement this new type of mobile ad:

1) Mobile version – Implement an anchor ad: this is a new ad format that is working really well for mobile. It is a 320×50 ad units that remains fixed in the lower part of the screen, even when the user moves up and down in the page. I share with you the code. It will automatically only show for mobile users.

<script src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
<ins class=”adsbygoogle”
style=”display:none;width:320px;height:50px”
data-ad-client=”pub-xxxxxxxxxx”
data-ad-channel=”xxxxxxxxxxx”></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
params: { google_reactive_ad_format: 1 }
});
</script>

How can i do this within the framework of the ad system in the template?

Thanks in advance!

S

Post count: 7909

Hi,

Try to add it to the bottom of the footer.php file: http://screencast.com/t/NI3EzxUksJD

Thanks!

Post count: 226

hi there above or below the ?> ?

Post count: 226

will it show only on mobile version?

Post count: 226

I added it but did not worked. I tryed it before, in, and after the ?> and it is not displaying

Post count: 6600

Hi,

It should be added after the closing php tag “?>“.
Please try to add it and test your site on various mobile devices. I believe that the mobile screen should be detected and only then the ad should be loaded.
Please let me know how it goes and make sure you have the adsense code added and also provide your site’s url so I can check this.

Thanks

  • This reply was modified 11 years by Lucian.
Post count: 226

It worked thanks!!!

Post count: 260

Hey salo charly. how do you do that? i cant make it work 🙁

Post count: 226

I did exactly what they indicated here. make sure to test with you mobile to see the ads. and clean chache.

good luck!

Post count: 260

Thanks saloCharly. In my site The adsense block shows on the footer. In your site keeps fixed bottom in the mobile screen?

Post count: 226

yes its working for me properly, no idea why is not working for you… you should open a new ticket so support guys can help you….

Post count: 133

it doesnt work for me, tried all of the recommendations .. but still not working…:/

Post count: 22421

Hi,
Well I hope you are getting your own ad, not copying the one from here as this one will not work. You have to get your own ad code from google to replace this part:
data-ad-client=”pub-xxxxxxxxxx”
data-ad-channel=”xxxxxxxxxxx”>
The x-s will be replaced by the numbers provided by google. Then you can add the code like suggested above.
Thanks.

Post count: 133

i d like to add the sticky ad on mobile.. of course ma not using this ad code:) what bout the size there is nothig bout the size .. here is the code i ma trying to ad. http://screencast.com/t/NjHfIISZ86Mw

Post count: 22421

Hi,
First try the code in a default ad spot in the theme panel to see if it will display properly:
Then you can try it inside the theme files http://screencast.com/t/IMbThP1nkKp then if it works from the theme panel you can use a do_shortcode function inside the footer.php file like so:

(note that this code uses the custom ad 1 spot so you need to place your ad in the custom ad 1 field)
Thanks.

Post count: 133

hi iam already using the default ad spot for different ad…so that not the way probably….

Post count: 22421

Hi,
Then use another ad spot to test the code. I can’t test it on my end as i don’t have an ad code. You will have to do the testing. Use a custom ad spot or an empty ad spot and place it on your site to see if the ad shows up. Then use one of the custom ad spots in the code. There are 5 custom ad spots.
Thanks.

Post count: 133

Hi, i have tried to add the code to custom ad spot, but its not showing anything..:/

Post count: 22421

Ok,
If the standard ad implementation in the theme panel ad spots does not work, and the implementation showed above also does not work, you can try one more thing. Use another ad render software. Adrotate is a plugin that most people use. Try it out with it and if it still won’t work then it means your ad will require some custom implementation and you will have to hire a developer to help you out as we cannot offer any custom work at the moment.
Thank you!

Viewing 19 posts - 1 through 19 (of 19 total)
You must be logged in to reply to this topic.