> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.pixalate.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.pixalate.com/_mcp/server.

# Website tag blocking (Google Ad Manager)

> How publishers using Google Ad Manager (formerly DoubleClick for Publishers, DFP) set up and test Pixalate Tag Server blocking.

The Pixalate Tag Server checks ad requests from the browser against Pixalate's fraud detection before your ad code is released to the page. If a request looks suspicious or fraudulent, the Tag Server suppresses it, and no ads load for that visitor. This page is for publishers who serve ads with Google Ad Manager (called DoubleClick for Publishers, or DFP, before 2018) and Google Publisher Tag (GPT).

## How it works

The Tag Server makes a real-time decision for each ad request. It aims ads away from machine visitors, such as bots, malware and crawlers, without interfering with the human visitors who see your ads and without adding significant delay.

The decision comes from a model trained on historical and real-time data. Examples of the data points it uses:

* IP address
* User ID
* Visitor ID (cookie)
* User-agent string
* Geographic location
* How often requests arrive over different time ranges
* Overall traffic characteristics of the IP address, for example whether it comes from a gateway, a public proxy, a company network or a home router

## Before you start

You need these from Pixalate. To get them, contact your Pixalate account manager:

* A **Client ID** and a **Box ID**.
* The **Pixalate script tag** for your site, which replaces your GPT loader. Pixalate's ad operations team prepares it for your Client ID and Box ID.
* For testing, the URL of the **self-service test page** and a username and password for it.

## Add the Tag Server to your pages

This setup is in the page header, and needs the fewest changes to your pages.

#### Find your GPT loader

Find the script block that loads Google Publisher Tag (`gpt.js`). It's usually in the page header. On older pages it looks like this:

```html
<script type="text/javascript">
  var googletag = googletag || {};
  googletag.cmd = googletag.cmd || [];
  (function() {
    var gads = document.createElement('script');
    gads.async = true;
    gads.type = 'text/javascript';
    var useSSL = 'https:' == document.location.protocol;
    gads.src = (useSSL ? 'https:' : 'http:') +
      '//www.googletagservices.com/tag/js/gpt.js';
    var node = document.getElementsByTagName('script')[0];
    node.parentNode.insertBefore(gads, node);
  })();
</script>
```

#### Replace it with the Pixalate script tag

Replace the entire GPT script block with the script tag that Pixalate gave you.

#### Test both outcomes

Before you go live, check that your pages behave correctly when a visitor is blocked and when they aren't. See [Test your setup](#test-your-setup).

## Test your setup

You can force the blocked and not-blocked outcomes in two ways: with the `ef` flag, or from the self-service test page.

The Tag Server uses two template sections: code inside a `{?block}` section is rendered when an impression is blocked, and code inside a `{^block}` section is rendered when it isn't.

### Use the ef flag

The Pixalate script's `ef` flag takes these values:

| Value  | Behavior                                                                                        |
| ------ | ----------------------------------------------------------------------------------------------- |
| `ef=1` | Normal fraud detection. This is the default.                                                    |
| `ef=2` | Tests the blocked case: code in `{?block}` is rendered, and code in `{^block}` is left out.     |
| `ef=3` | Tests the not-blocked case: code in `{?block}` is left out, and code in `{^block}` is rendered. |

Ask Pixalate where to set `ef` in your script tag.

### Use the self-service test page

The test page applies an action to the IP address you're browsing from, as Pixalate detects it.

1. Open the test page URL that Pixalate gave you.
2. Sign in with the username and password Pixalate supplied.
3. Choose an option:

| Option       | Effect on your current IP address                                                               |
| ------------ | ----------------------------------------------------------------------------------------------- |
| Block Me     | Tests the blocked case: code in `{?block}` is rendered, and code in `{^block}` is left out.     |
| Unblock Me   | Tests the not-blocked case: code in `{?block}` is left out, and code in `{^block}` is rendered. |
| Whitelist Me | Whitelists your IP address, so it bypasses the fraud checks.                                    |

Every option expires after one hour. Your IP address then goes back to its original state.

## Related

* [Pre-bid data feeds](/data-feeds/overview): block lists for platforms that block before the bid.
* [Fraud API](/apis/fraud-api): check an IP address, device ID or user agent in real time.
* [Blocking FAQ](/data-feeds/faq)

Questions? Contact your Pixalate account manager or [support@pixalate.com](mailto:support@pixalate.com).