How to adjust canvas acording to Google Admob Banner ?

I am implementing a banner ad for my game but it shows over the UI buttons so I want to adjust canvas size(screen ratio maybe?) acording to banner size so my buttons will be visible. Is there any way I can get the banner size, position data and manipulate canvas according to that? Or is there any other way to solve my problem?

For Smart Banners


Three banner ad heights (in dp, density-independent pixel) are available

32 - used when the screen height of a
device is less than 400

50 - used
when the screen height of a device is
between 400 and 720

90 - used when
the screen height of a device is
greater than 720

For my option with Scale mode “Scale with screen size” i use this method:
Calculate percentage of banner size relative to screen size and apply this percent to Canvas scaler reference resolution.

private CanvasScaler canvasScaler;
private BannerView bannerView;

private void RequestBanner()
{
    AdSize adSize = AdSize.SmartBanner;
    this.bannerView = new BannerView(bannerId, adSize, AdPosition.Bottom);
    //request banner...
}

private float CalculateCanvasBannerSize()
{
   float bannerSizePixels = Screen.height <= 400 ? 32 : Screen.height < 720 ? 50 : 90;
   var percent = (100f / Screen.height) * bannerSizePixels;
   var bannerSize = canvasScaler.referenceResolution.y * (percent / 100f);
   return bannerSize;
}