# Ad Pixel & GTM Tag Detector — Meta, Google Ads, TikTok & GA4 (`spiky_closet/gtm-ad-pixel-detector`) Actor

\[$1.50/1K domains, $0 start fee] Detect Meta Pixel, Google Ads (AW-), GTM containers, TikTok, LinkedIn & Reddit ad pixels plus /ads.txt networks without a headless browser.

- **URL**: https://apify.com/spiky_closet/gtm-ad-pixel-detector.md
- **Developed by:** [AdPulse Labs](https://apify.com/spiky_closet) (community)
- **Categories:** Marketing, SEO tools, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 domain scanneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## GTM & Ad Pixel Detector (Meta, Google Ads, TikTok, LinkedIn + MCP)

Statically unpack Google Tag Manager (`gtm.js`) containers and HTML to extract Meta Pixel, Google Ads (`AW-`/`GT-`), GA4, TikTok, LinkedIn, Bing UET, Reddit, Pinterest, X, and HubSpot IDs — plus DNS SaaS verification and explicit CRM `scanConfidence` scoring.

Built as a stateless, zero-browser Go binary (`256 MB` RAM). Supports **Apify Console batch runs, Scheduling, Webhooks, Apify API, Standby REST, and Streamable HTTP MCP (`/mcp`)**.

***

### What Is GTM & Ad Pixel Detector (Meta, Google Ads, TikTok, LinkedIn + MCP)?

Most ecommerce and SaaS sites hide ad pixels inside Google Tag Manager containers and block them behind EU consent banners. Instead of launching heavy Chromium browsers, this Go Actor downloads `gtm.js`, decodes its internal `"macros"` and `"tags"` JSON arrays statically, skips `__paused` tags, resolves `["macro", N]` constant pixel IDs, and falls back to DNS (`MX`/`TXT`/`SPF`/`_dmarc`) when sites return WAF `403`.

### What Data Can You Extract?

- **Exact ad pixel & tag IDs:** `gtmContainerIds`, `googleAdsIds` (`AW-`, `GT-`), `ga4MeasurementIds` (`G-`), `metaPixelIds`, `linkedinPartnerIds`, `tiktokPixelIds`, `bingUetIds`, `otherPixelIds` (`reddit`, `pinterest`, `x_twitter`, `snapchat`, `clarity`, `hotjar`), and `hubspotPortalId`.
- **Explicit CRM scan confidence (`v1.2`):** `htmlInspected`, `scanConfidence` (`high`/`medium`/`none`), `scanConfidenceScore` (`0.00`–`1.00`), `scanCoverageNote` (distinguishes full HTTP+DNS scans from DNS-only WAF-403 fallbacks), and `scannedAt`.
- **70+ DNS-verified enterprise SaaS:** Detects `Stripe`, `OpenAI`, `Anthropic`, `Slack`, `Google Workspace`, `Microsoft 365`, `HubSpot`, `Cursor`, and DMARC posture even behind Cloudflare/Akamai `403`.

***

### How to Use GTM & Ad Pixel Detector (Meta, Google Ads, TikTok, LinkedIn + MCP) (Step-by-Step Tutorial)

1. Click **Start** with the prefilled targets (`klaviyo.com`, `shopify.com`, `hubspot.com`, `gymshark.com`) or enter any list of domains, URLs, or B2B emails.
2. Keep `unpackGtm: true` and `checkDns: true`, and optionally enable `onlyWithAdPixels: true` so you only pay for active paid-media spenders.
3. Click **Start** — runs in seconds on `256 MB` RAM using single-pass Aho-Corasick scanning with zero browsers or proxies.
4. Export **CSV, JSON, or Excel**, or wire into **Clay, HubSpot, n8n, Make, Zapier, Apify API, or MCP (`/mcp`)**.

***

### Input & Output Examples

#### Input Example (JSON)

```json
{
  "domains": ["klaviyo.com", "shopify.com", "hubspot.com"],
  "unpackGtm": true,
  "checkDns": true,
  "onlyWithAdPixels": false
}
```

#### Sample JSON Output

```json
{
  "domain": "klaviyo.com",
  "htmlInspected": true,
  "scanConfidence": "high",
  "scanConfidenceScore": 0.98,
  "scanCoverageNote": "full_http_and_dns",
  "gtmContainerIds": ["GTM-M28G2G"],
  "adPlatforms": ["Google Ads", "Meta Pixel", "LinkedIn Insight Tag", "TikTok Pixel", "Reddit Pixel"],
  "emailProvider": "Google Workspace"
}
```

***

### API, Python, cURL & MCP Integration

#### Python (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("spiky_closet/gtm-ad-pixel-detector").call(run_input={
  "domains": ["klaviyo.com", "shopify.com", "hubspot.com"],
  "unpackGtm": True,
  "checkDns": True,
  "onlyWithAdPixels": False
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

#### cURL (Synchronous JSON)

```bash
curl -X POST "https://api.apify.com/v2/acts/spiky_closet~gtm-ad-pixel-detector/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{   "domains": ["klaviyo.com", "shopify.com", "hubspot.com"],   "unpackGtm": true,   "checkDns": true,   "onlyWithAdPixels": false }'
```

#### AI Agents (Streamable HTTP MCP)

Connect Claude Desktop, Cursor, Windsurf, or n8n AI Agents directly to:
`https://spiky-closet--gtm-ad-pixel-detector.apify.actor/mcp` (`Authorization: Bearer YOUR_APIFY_TOKEN`)

***

### How Much Does It Cost?

Pay-Per-Event (`$0` start fee) with automatic **Bronze, Silver, Gold, Platinum, and Diamond** volume discounts. Your `$5/mo` Apify Free credit scans thousands of domains per month for `$0`. Domains filtered out by `onlyWithAdPixels: true` incur `$0`.

***

### Frequently Asked Questions

**Does this Actor require proxies or headless browsers?**\
No. It runs pure Go HTTP/JSON/DNS workers inside `256 MB` RAM without Playwright, Puppeteer, or residential proxy costs.

**Can I connect this to n8n, Make, Zapier, or Clay?**\
Yes. Use the official Apify integration node in n8n/Make/Zapier, call the synchronous REST endpoint from Clay HTTP Enrichment, or attach `/mcp` to AI agents.

**What happens if a domain or target returns no results?**\
Unreachable, empty, or filtered-out targets are never charged (`$0`).

***

### Related Actors

Explore other fast, browserless Go data & MCP Actors built on the same low-memory architecture:

- **[Google Ads Transparency Scraper & MCP](https://apify.com/spiky_closet/google-ads-transparency-scraper)** — Extract active Google Search, YouTube & Display ads, EU/EEA+TR DSA reach, and B2B ad-spend screening.
- **[Website Tech Stack, GTM Ad Pixels & DNS SaaS Detector](https://apify.com/spiky_closet/tech-stack-ad-pixel-detector)** — Detect 180+ technologies, unpack static `gtm.js` containers for ad pixel IDs, and verify 70+ SaaS tools via DNS.
- **[Unified 6-ATS Jobs, Salary & Hiring Intelligence](https://apify.com/spiky_closet/ats-jobs-hiring-intel)** — Scrape Ashby, Greenhouse, Lever, Workday, SmartRecruiters & BambooHR with salary normalization and freshness scoring.
- **[Website Contacts, SaaS Pricing & /llms.txt Extractor](https://apify.com/spiky_closet/website-contacts-pricing-intel)** — Extract role-classified business emails, 12+ socials, live `/pricing` tiers, DNS MX/SPF, and `/llms.txt` briefs.
- **[SEC EDGAR Startup Funding (Form D), Insider Buys (Form 4) & 8-K](https://apify.com/spiky_closet/sec-funding-insider-mcp)** — Query official SEC filings with SPV filtering, VWAP insider cluster buys, and `EX-99.1` press releases.

# Actor input Schema

## `domains` (type: `array`):

Enter company domains ('hubspot.com'), full URLs ('https://www.klaviyo.com/pricing'), or work emails ('ceo@linear.app'). Click Start right away to test with the 3 prefilled sample domains.

## `bulkDomains` (type: `string`):

Paste a multiline or comma-separated list of domains, URLs, or emails. Duplicates and URL paths are cleaned automatically.

## `onlyWithAdPixels` (type: `boolean`):

Output only domains with active paid advertising pixels (Google Ads, Meta Pixel, LinkedIn, TikTok, Microsoft/Bing, X, Reddit, Pinterest, Snapchat).

## `mustHaveAny` (type: `array`):

Keep companies using at least one listed tool (e.g. 'Shopify', 'Meta Pixel', 'HubSpot', 'Stripe', 'OpenAI').

## `mustHaveAll` (type: `array`):

Keep only companies using every listed tool together (e.g. \['Shopify', 'Meta Pixel']).

## `mustNotHave` (type: `array`):

Exclude companies already using a specific tool (e.g. \['Klaviyo'] to find Shopify stores not yet using Klaviyo).

## `unpackGtm` (type: `boolean`):

Unpacks Google Tag Manager containers so Meta, Google Ads, LinkedIn, TikTok, and GA4 pixel IDs are found even behind cookie consent banners.

## `checkDns` (type: `boolean`):

Checks public DNS records to identify Google Workspace, Microsoft 365, Stripe, OpenAI, Anthropic, HubSpot, Slack, and Rippling — works even when websites block crawlers (HTTP 403).

## `checkAdsTxt` (type: `boolean`):

Also checks /ads.txt on media and publisher sites.

## `maxResults` (type: `integer`):

Stop the run after emitting this many matching domains (0 = no limit).

## `maxConcurrency` (type: `integer`):

Number of websites scanned simultaneously.

## `proxyConfiguration` (type: `object`):

Optional proxy override. Default direct mode ($0 proxy cost) already achieves ~90% HTTP + 100% DNS coverage.

## Actor input object example

```json
{
  "domains": [
    "klaviyo.com",
    "shopify.com",
    "hubspot.com",
    "gymshark.com"
  ],
  "onlyWithAdPixels": false,
  "unpackGtm": true,
  "checkDns": true,
  "checkAdsTxt": false,
  "maxResults": 0,
  "maxConcurrency": 15,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `adPixels` (type: `string`):

No description

## `enterpriseSaaS` (type: `string`):

No description

## `fullTechStack` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "domains": [
        "klaviyo.com",
        "shopify.com",
        "hubspot.com",
        "gymshark.com"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("spiky_closet/gtm-ad-pixel-detector").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "domains": [
        "klaviyo.com",
        "shopify.com",
        "hubspot.com",
        "gymshark.com",
    ],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("spiky_closet/gtm-ad-pixel-detector").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "domains": [
    "klaviyo.com",
    "shopify.com",
    "hubspot.com",
    "gymshark.com"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call spiky_closet/gtm-ad-pixel-detector --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,spiky_closet/gtm-ad-pixel-detector"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/2vmQx0TfQVoWY1LWF/builds/i0qrGiEuPfIeBTgBR/openapi.json
