# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.playgama.com/playgama/sdk/api/advertisement/adblock.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
