adSense.height()

Type Function
Return value none
Revision Release 2022.3683
Keywords adSense, Google Ads, Google AdSense, height
See also adSense.show()
adSense.*

Overview

Returns banner height in Solar2D display units

Syntax

adSense.height()

Example

local adSense = require( "plugin.adSense" )

-- AdSense Ads listener function
local function adListener( event )

    if ( event.phase == "init" ) then  -- Successful initialization
        adSense.show("banner",{adSlot="xxxxxxxxx", height=150, position="bottom"})

        --Later
        print("AdSense Banner Height")
        print(adSense.height())
    end
end

-- Initialize Ad Sense
adSense.init(adListener, {clientId="ca-pub-xxxxxxxxxxxxxxxx"} )