adSense.hide()

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

Overview

Hide AdSense banner ad

Syntax

adSense.hide(  )

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
        adSense.hide()
    end
end

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