> For the complete documentation index, see [llms.txt](https://wiki.playgama.com/playgama/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.playgama.com/playgama/bridge-sdk-v1/bridge-sdk/api/advertisement/adblock.md).

# AdBlock

Detect whether the player has an ad blocker enabled. This is informational only: it does not suppress ads, but it lets you adapt UI, skip empty banner slots, or show a polite prompt.

Call this when you need to adapt ad-related UI for players with blocked ads.

{% tabs %}
{% tab title="Plain JS" %}

```javascript
bridge.advertisement.checkAdBlock()
    .then(result => {
        console.log(result) // true or false
    })
    .catch(error => {
        console.log(error)
    })
```

{% endtab %}

{% tab title="Unity" %}

```csharp
private void Start()
{
    Bridge.advertisement.CheckAdBlock(OnCheckAdBlockCompleted);
}

private void OnCheckAdBlockCompleted(bool result)
{
    Debug.Log(result); // true or false
}
```

{% endtab %}

{% tab title="Construct 3" %}

<figure><img src="/files/WS7IYjndz7umrADtntOQ" alt=""><figcaption></figcaption></figure>

<details>

<summary>Copy This Example</summary>

```
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[{"id":"check-adblock","objectClass":"PlaygamaBridge"}]},{"eventType":"block","conditions":[{"id":"on-check-adblock-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"is-adblock-detected","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"adblock detected"}]}]}]}
```

</details>
{% endtab %}

{% tab title="GDevelop" %}

<figure><img src="/files/sxi2MAJ2rhZVLP6Ok16x" alt=""><figcaption></figcaption></figure>

<details>

<summary>Copy This Example</summary>

```
{"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PanelSpriteButton::PanelSpriteButton::IsClicked"},"parameters":["Button",""]}],"actions":[{"type":{"value":"PlaygamaBridge::CheckAdBlock"},"parameters":["",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnCheckAdBlockCompleted"},"parameters":["",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsAdBlockDetected"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"ad block detected\"","\"info\"",""]}]}]}],"eventsCount":2,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}
```

</details>
{% endtab %}

{% tab title="Godot" %}
{% tabs %}
{% tab title="Godot 3.x" %}

```gdscript
func _ready():
    Bridge.advertisement.check_adblock(funcref(self, "_on_check_adblock_completed"))

func _on_check_adblock_completed(result):
    print(result) # true or false
```

{% endtab %}

{% tab title="Godot 4.x" %}

```gdscript
func _ready():
    Bridge.advertisement.check_adblock(Callable(self, "_on_check_adblock_completed"))

func _on_check_adblock_completed(result):
    print(result) # true or false
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="GameMaker" %}

```javascript
playgama_bridge_advertisement_check_adblock()

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_advertisement_check_adblock_callback" {
    if async_load[? "success"] {
        var is_adblock_detected = async_load[? "data"]
    }
}
```

{% endtab %}

{% tab title="Defold" %}

```lua
local bridge = require("bridge.bridge")

function init(self)
	bridge.advertisement.check_ad_block(function (_, data)
		print("Is adblock detected: ", data)
	end, 
	function ()
		-- error
	end)
end
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
bridge.advertisement.checkAdBlock()
    .then(result => {
        console.log(result) // true or false
    })
    .catch(error => {
        console.log(error)
    })
```

{% endtab %}
{% endtabs %}

<details>

<summary>Platform support · all 28 platforms</summary>

**Supports:** `absolute_games`, `bitquest`, `crazy_games`, `discord`, `dlightek`, `facebook`, `game_distribution`, `gamepush`, `gamesnacks`, `huawei`, `jio_games`, `lagged`, `microsoft_store`, `msn`, `ok`, `playdeck`, `playgama`, `poki`, `portal`, `reddit`, `samsung`, `telegram`, `tiktok`, `vk`, `xiaomi`, `y8`, `yandex`, `youtube`

</details>
