Question

I am trying to integrate inMobi ads into my Monaca project. The current Monaca tutorial seems to be outdated so I talked to one of the InMobi staff. He told me to put this code in where I want it.

<script type="text/javascript"> var inmobi_conf = { siteid : myID, slot : "15", }; </script><script type="text/javascript" src="http://cf.cdn.inmobi.com/ad/inmobi.js"></script>

myID is obviously replaced with my property ID. Whenever I add this between or outside a ons-scroller tag I cannot see the ads. The only time when the ads work is when I put it in index.html before the ons-screen tag, but then I am not able to move the ad to the bottom. Where is the best place to put this code in the page I want?

Thanks, Ben

Was it helpful?

Solution 2

You can add it in index.html after ons-screen. and then position it with this css.

.inmobi-ad {
    position: fixed;
    bottom: 0;
}

OTHER TIPS

There are a couple of ways you could achieve this.

  1. sticky feature (scroll down to read on how to stick the ad to the bottom) https://www.inmobi.com/support/integration/23906512/22051163/mobile-web-integration-guide/
  2. adhesion ads ( upcoming feature, watch out for this :-) )

Akshay JS Dev, InMobi

In your index.html page, you should:

<body>
<ons-screen page="home_navigator.html"></ons-screen>
<script type="text/javascript">
    var inmobi_conf = {
    siteid : 'f2aca88ff3d94715b354dd6af9da8326',
    slot : "15",
    sticky: "bottom"
};
</script>
<script type="text/javascript" src="http://cf.cdn.inmobi.com/ad/inmobi.js"></script>
</body>

And you might need to put ons-scroller in another page, page1.html for example to get your scroller work and ads appear at the bottom. :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top