Type Function Return value none Revision Release 2026.3728 Keywords ads, advertising, unityads, setPrivacyMode See also unityads.init() unityads.*
Set a COPPA compliance mode for the app. Call this before initialization (before unityads.init()).
unityads.setPrivacyMode( privacyMode )
String. Supported modes:
"app" — The entire app is directed at children (COPPA applies)."mixed" — The app has a mixed audience (COPPA applies as a precaution)."none" — The app is not directed at children.local unityads = require( "plugin.unityads.v4" )
local function adListener( event )
if ( event.phase == "init" ) then -- Successful initialization
end
end
-- Set privacy mode before initialize
unityads.setPrivacyMode( "app" )
-- Initialize the plugin
unityads.init( adListener, { gameId="YOUR_LEVELPLAY_APP_KEY" } )