question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to place the MEDIUM_RECTANGLE banner ad into content

See original GitHub issue

Tried to place the MEDIUM_RECTANGLE Banner ad into my code and It is showing smart banner ad and its comming into center place

i am using IONIC Capacitor

const showTabBarBanner = () => {
    const options: AdOptions = {
      adId: 'ca-app-pub-XXX/XXX',
      adSize: AdSize.MEDIUM_RECTANGLE,
      position: AdPosition.CENTER,
    };

    // Show Banner Ad
    AdMob.showBanner(options)
      .then(
        async (value: any) => {
          await Toast.show({
            text: ''
          })
        },
        (error: any) => {
          console.error(error); // show error
        }
      );
    // Subscibe Banner Event Listener
    AdMob.addListener('onAdLoaded', async (info: boolean) => {
      console.log('Showing TabBar Banner AD.');
    });
  }

I want to show 300x250 ad into my content. can you please help me on this.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
distantecommented, Apr 12, 2021

Hi @rdlabo -san, I believe OP is asking the same question that I have - is it possible to implement ads that are embedded within the HTML tags and will scroll along with the app content using this plugin?

I have attached two examples below:

InkedIMG_7268_LI

IMG_7269

Thank you so much in advance

This can not be done with the current implementation and in general it will be really hard to implement since what we see in those Screenshots are native ads.

In theory, and I will talk about android that is what I know, you could register some event attached to a div in the web view that sends the position to the native part, and ask the native part to move the View into that place.

There we could have problems like lag so the ad is placed above the content until the Javascript thread is free and can send the event.

Another problem is how do you scrolls it outside the screen and manages how it returns to it. Androids uses a RecyclerView element to manage that and prevent memory leaks. We can not use that so we should create some kind of webview recycler view handling mechanism that would be really prone to memory leaks.

So again, that is not posible right now but we are always open and glad to get PRs.

0reactions
rdlabocommented, May 8, 2021

Thanks for the issue. I don’t see any more questions, so I’ll close this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Banner ad guidance: 300x250 - Google AdMob Help
The 300x250 ad is the IAB medium rectangle that is available for both phones and ... This includes placing the ad over a...
Read more >
Banner Ads - Meta for Developers - Facebook
A banner is a small bar ad that appears at the bottom or top of your content. Banner ads usually measure 320 x...
Read more >
Medium Rectangle Ads [MREC]
MREC advertising best practices​​ Place MREC ads at natural points: To see high levels of engagement, place your MREC ads at high visibility...
Read more >
Medium Rectangle Ads – A Flexible Monetization Tool For ...
Medium rectangle ads are medium-format ad units sized between mobile banners and full-screen interstitials. At this scale, advertisers can include more details ...
Read more >
MPU (300x250)
It is commonly called a 300×250 or MPU but is also known as a Med Rec, MREC, or Medium Rectangle. MPUs are the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found