How to hide and show unity banner ads

Hello, I am using unity monetization 3.0 in my game and I only want to show banner ads on the main menu.
But when a banner is hidden with Advertisment.banner.hide() it can’t be shown again with Advertisment.banner.show

If anyone has a fix to this that would be great, thanks.

I have the same problem exactly.Rewarded video placement works perfectly but banner ads Impressions don’t count even it shows.I have disabled ads in unity services but installed monetization.And i’m building app in android studio because of unity editor key signing error.

Does it need to be initialized only one time?

Check out Can I make banner ads optional for the player?

2 Likes

This is not documented in ads integration. Thank you.

1 Like

hey mate its easy just use a public boolean that is equal false and then enable it in the scenes that u want it to work in and to disable it put the boolean false and make shoor that in ur script u have Advertisment.banner.hide() in else. ex:
public void Update()
{
if (ItsOn == true)
{
Advertisement.Banner.Show(BannerAd);
}
else
{
Advertisement.Banner.Hide();
}
}

3 Likes

If you have a banner script attached in the scene where you want to show it, you can add this to the script:

private void OnDestroy()
    {
        Advertisement.Banner.Hide();
    }

And if the same banner script does the start()->ShowBannerWhenReady() coroutine, it will reappear in that specific scene. Posting for those who come here from Google, like me. Adding a check like this in Update seems like a bad idea, because it will constantly be checking, every frame, forever…

2 Likes