# Ad Pixel & Marketing Stack Detector (`velveteen_driver/marketing-stack-detector`) Actor

See which ad pixels and tags (Meta, Google Ads, TikTok, LinkedIn, Bing...) a website has installed, and which analytics, email marketing, chat, booking, reviews, shop and website tools it uses. Reads the public Google Tag Manager container too. Follows robots.txt.

- **URL**: https://apify.com/velveteen_driver/marketing-stack-detector.md
- **Developed by:** [Elliott](https://apify.com/velveteen_driver) (community)
- **Categories:** Marketing, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 website checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Ad Pixel & Marketing Stack Detector

Find out which **ad pixels and tags** a website has installed and which **marketing tools** it uses. Paste a list of websites and get, for each one:

- **Ad tags installed**: Meta (Facebook/Instagram) Pixel, Google Ads, Google Floodlight, TikTok, LinkedIn Insight Tag, Microsoft (Bing) Ads UET, Pinterest, Snapchat, X, Reddit, Criteo, Quantcast, Taboola/Outbrain
- **Analytics**: Google Analytics 4, Tag Manager, Universal Analytics (old), Hotjar, Clarity, Segment, Mixpanel, Matomo, Plausible
- **Email marketing and CRM**: Klaviyo, Mailchimp, HubSpot, ActiveCampaign, Omnisend, Brevo, Constant Contact, Kit, MailerLite, Salesforce/Pardot, Zoho, Pipedrive
- **Chat**: Intercom, Drift, Tidio, LiveChat, Zendesk, Crisp, Tawk.to, Facebook Messenger chat, WhatsApp button
- **Booking**: Calendly, Acuity, Square Appointments, Fresha, Booksy, OpenTable, ResDiary/SevenRooms
- **Reviews**: Trustpilot, Trustindex/Featurable review widgets, Yotpo, Judge.me, Reviews.io, Feefo
- **Shop and website platform**: Shopify, WooCommerce, BigCommerce, Magento, Wix, Squarespace, Webflow, WordPress, HubSpot CMS, GoDaddy, Duda, Framer, Weebly, Joomla, Drupal, Next.js
- **IDs**: Meta Pixel IDs, GA4 IDs, Tag Manager IDs and Google Ads IDs where visible

### What "ad tags installed" means

`adTagsInstalled` is true when at least one ad platform's pixel or tag is installed on the site (in the page or as a live tag in its Tag Manager container). It shows the site is set up to measure or retarget ads. It does **not** prove the business is currently running or paying for ads: tags often stay installed after campaigns stop.

### How detection works

Detection is strict, to avoid false positives from a product merely being mentioned on a page:

- Script, iframe, stylesheet and form URLs are matched on each tool's own hosts and paths (for example `connect.facebook.net/.../fbevents.js`), never on bare product names.
- Inline scripts are matched on the tool's specific init call (for example `fbq('init', ...)`, `ttq.load(...)`), or on its loader URL only where the code actually loads it (a `src` assignment or script insertion). A URL that is merely mentioned in code does not count.
- Only code that runs counts. Data blocks (`application/json`, `application/ld+json`, import maps, templates, Next.js `__NEXT_DATA__` and similar), HTML comments, `preconnect` / `dns-prefetch` hints, Content-Security-Policy lists and `<meta http-equiv>` content are ignored, because they name hosts a site allows or mentions, not tags it loads. Scripts held back by a cookie consent manager until the visitor agrees do count, as they are installed.
- Platform path markers such as `/wp-content/` or `/_next/static/` only count when served from the site's own domain.
- Most detectors only read the page source, so they miss tags loaded through **Google Tag Manager**. This one also reads the site's public Tag Manager container and counts only its live tags: Google tag types by their template key (Google Ads, Floodlight, GA4, Universal Analytics, Bing UET, LinkedIn, Hotjar) and Custom HTML tags by the same strict rules as the page. Paused tags are ignored. Tags built from Tag Manager community templates are not counted.

### Who it's for

- **Agencies**: see which prospects have ad tracking set up, and which have none.
- **SaaS sales teams**: find users of a tool you integrate with or replace.
- **Researchers**: map the marketing stack of a whole market.

Tick **Only return websites with ad tags installed** to filter the results. You only pay for the rows returned.

### Output fields

`website`, `finalUrl`, `adTagsInstalled`, `adPlatforms`, `ads`, `analytics`, `email`, `crm`, `chat`, `booking`, `reviews`, `ecommerce`, `cms`, `consent`, `metaPixelIds`, `ga4Ids`, `gtmIds`, `googleAdsIds`, `tagManagerContainersRead`, `pagesRead`, `toolCount`, `error`, and where relevant `innerPageSkipped` and `tagManagerNote`.

### Limits

- At most 2 pages per site: the homepage, plus one contact, about, shop or services page only if you turn on **Also check one inner page** (off by default).
- It reads the HTML and the Tag Manager file without running the site's scripts, so tags added later by a site's own app code, or by Tag Manager community templates, may not be visible.
- It never logs in or submits anything.

### Data source and licence

The actor reads only:

- public pages of the websites you supply (the homepage, and one inner page if you turn that on), and
- the public Google Tag Manager container script for container IDs found on those pages (`https://www.googletagmanager.com/gtm.js?id=GTM-...`), the same file every visitor's browser downloads.

No third-party database is used. The output is technical facts about which tools a site loads; page content is not stored or republished.

### Responsible use

- The actor identifies itself honestly with the User-Agent `Mozilla/5.0 (compatible; MarketingStackDetector/1.0; +https://apify.com/velveteen_driver/marketing-stack-detector)`.
- It follows each site's robots.txt for the homepage and the inner page, and skips the site with an `error` if robots.txt disallows it or can't be read (server error).
- Each Tag Manager container is fetched at most once per run (sites checked at the same time share one download), and all Tag Manager fetches stop for the run if googletagmanager.com answers HTTP 429 or its robots.txt disallows the file.
- At most 10 websites are checked at the same time, and requests to any one host are at least 1 second apart.
- Use the results lawfully, for example under UK GDPR and PECR if you contact the businesses, and within Apify's terms.

# Actor input Schema

## `websites` (type: `array`):

Domains or full addresses, one per line.

## `onlyWithAdTags` (type: `boolean`):

Only websites where at least one ad platform's pixel or tag is installed. You're only charged for the websites returned.

## `checkInnerPage` (type: `boolean`):

Off by default. When on, also reads one contact, about, shop or services page linked from the homepage, if the site's robots.txt allows it.

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

How many websites to check in parallel (up to 10). Requests to any one host are always at least 1 second apart.

## Actor input object example

```json
{
  "websites": [
    "hubspot.com",
    "pret.co.uk"
  ],
  "onlyWithAdTags": false,
  "checkInnerPage": false,
  "maxConcurrency": 5
}
```

# Actor output Schema

## `results` (type: `string`):

All results in the default dataset, shown in the overview table.

# 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 = {
    "websites": [
        "hubspot.com",
        "pret.co.uk"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("velveteen_driver/marketing-stack-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 = { "websites": [
        "hubspot.com",
        "pret.co.uk",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("velveteen_driver/marketing-stack-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 '{
  "websites": [
    "hubspot.com",
    "pret.co.uk"
  ]
}' |
apify call velveteen_driver/marketing-stack-detector --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,velveteen_driver/marketing-stack-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/KXFtMTHoxmGSOtOyB/builds/8EUfOFQc6nS1Qu9Vm/openapi.json
