Mobile anchor ad in newsmag

Posted in: Newsmag
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: 3343

Hi,

Here is a quick implementation, if you want to try.

1. Edit footer.php file and add you ad code like here: http://screencast.com/t/J4W4GpzOyo
http://pastebin.com/8DPv2wAw

2. Add this CSS in Theme panel -> Custom CSS section:

.my-sticky-ad {
  display: none;
}
@media (max-width: 767px) {
  .my-sticky-ad {
    display: block;
    z-index: 9999;
    position: fixed;
    bottom: 0;
    left: 50%;
    -webkit-transform: translateX(-50%);
    ms-transform: translateX(-50%);
    transform: translateX(-50%);
  }
}

Thanks!

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

hi there,
done it but is displaying, in the half rigth of the screen.

S

Post count: 7909

Hi,

Please provide a link so we can take a look and inspect this.

Thanks!

Post count: 226

hi Alin, Thanks I fixed it my self by changing left:50% to 0.

Post count: 45

Thanks you so much guys. That’s I need.:)

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