XiaTools

How to Identify Tracking Codes and Pixels on a Website

Updated 09 Oct 2026

Performing an analytics ID lookup allows you to uncover hidden tracking codes, web analytics tags, and marketing pixels embedded in any website's source code. Whether you are conducting a competitive audit, verifying your own tag implementation, or checking third-party scripts for privacy compliance, knowing how to systematically extract these tracking identifiers is a crucial skill for web developers and digital marketers.

To quickly discover if multiple domains share the same tracking infrastructure, you can use the Same Owner Websites tool, which maps out connected properties using shared analytics identifiers. By entering a tracking code into this utility, you instantly reveal a network of sites utilizing the exact same tracking setup.

Understanding Website Tracking Codes and Pixels

Websites utilize various tracking snippets to monitor user behavior, measure conversion rates, and retarget visitors across advertising networks. These snippets generally fall into two categories: client-side JavaScript tags and server-side tracking configurations.

Most tracking technologies rely on a unique identifier string—such as a Google Tag ID, a Meta Pixel ID, or a LinkedIn Partner ID—embedded inside the tracking script. Identifying these IDs gives you immediate insight into which analytics platforms and marketing channels a site actively uses.

Common Tracking ID Formats

Before launching an investigation, familiarize yourself with the standard syntax of popular tracking identifiers:

  • Google Analytics 4 (GA4): Prefixed with G- followed by alphanumeric characters (e.g., G-ABC123XYZ).
  • Universal Analytics (Legacy): Prefixed with UA- followed by numbers (e.g., UA-12345678-1).
  • Google Tag Manager (GTM): Prefixed with GTM- followed by alphanumeric characters (e.g., GTM-K7L9MNOP).
  • Meta (Facebook) Pixel: A numeric string typically consisting of 15 to 16 digits (e.g., 123456789012345).
  • TikTok Pixel: Prefixed with alphanumeric strings or formatted as C-prefixed codes (e.g., C1234567890ABCDEF).
  • Hotjar: A numeric site ID typically consisting of 6 to 7 digits (e.g., 1234567).

Step-by-Step Methods for Analytics ID Lookup

Depending on your technical comfort level and whether you have backend access, you can use several methods to extract tracking IDs from a target website like example.com.

Method 1: Inspecting Page Source Code

The most direct way to find a tracking ID is to read the raw HTML markup delivered to the browser.

  1. Open your web browser and navigate to the target website (e.g., https://example.com).
  2. Right-click anywhere on the page and select View Page Source (or press Ctrl+U on Windows or Cmd+Option+U on Mac).
  3. Press Ctrl+F or Cmd+F to open the search bar.
  4. Type common keywords like G-, UA-, GTM-, or fbq('init' into the search box.
  5. Examine the surrounding JavaScript to locate the exact identifier string.

Method 2: Using Browser Developer Tools and Network Tab

Many modern sites dynamically load tracking scripts via JavaScript containers long after the initial HTML document loads. Viewing the static source code might miss these elements, making the browser's Network tab essential.

  1. Open the target website in your browser.
  2. Open Developer Tools by pressing F12 or right-clicking and selecting Inspect.
  3. Navigate to the Network tab.
  4. Refresh the page to capture all incoming and outgoing requests.
  5. In the filter box, type tracking domains or query parameters such as collect?v=2 (for GA4) or tr/?id= (for Meta Pixel).
  6. Click on a matching request and inspect the request URL or payload parameters to extract the embedded analytics ID.

Method 3: Command-Line Automation with Curl

If you prefer working from the terminal or need to automate lookups across a batch of domains, you can fetch the HTML using curl and parse it with command-line utilities like grep.

curl -s https://example.com | grep -oE '(G-[A-Z0-9]{9,10}|GTM-[A-Z0-9]{6,8}|UA-[0-9]{4,10}-[0-9])'

Sample Output:

G-XY123Z4578
GTM-WXYZ789

This command performs a silent HTTP GET request on example.com and uses regular expression matching to isolate standard Google property codes directly from the output stream.

Comparison of Tracking Identification Techniques

Technique Speed Complexity Detects Dynamic Scripts? Best Use Case
View Source Instant Low No Quick manual checks of static HTML
Browser Dev Tools Fast Medium Yes Comprehensive debugging and verification
Command Line (Curl) Fast High No Bulk auditing and script automation
Browser Extensions Instant Low Yes Everyday marketing and analytics audits

Common Mistakes and How to Fix Them

When performing an analytics ID lookup, engineers and marketers often run into a few frequent pitfalls:

  • Relying Solely on Static Source Code: Many websites deploy tags through container systems like Google Tag Manager or custom tag loaders. If you only look at View Page Source, you may miss tags loaded asynchronously. Always cross-reference with the Network tab.
  • Confusing Development and Production IDs: Developers frequently hardcode staging tracking IDs (G-TEST1234) in test environments (192.0.2.10). Ensure you are auditing the live production URL rather than a local staging server.
  • Ignoring Consent Management Platforms (CMP): If a site uses a cookie banner, tracking scripts may be blocked until the user accepts cookies. Clear your cookies or simulate a consent-granted state to view hidden tags.

Quick Checklist for Tracking Code Audits

  • Open the target website in an incognito or private browsing window.
  • Check the static page source for hardcoded G-, UA-, or GTM- prefixes.
  • Inspect the Network tab for outbound requests to google-analytics.com or facebook.com.
  • Verify whether a Consent Management Platform is blocking tracking scripts.
  • Plug discovered IDs into the Same Owner Websites utility to map connected digital properties.

By combining browser inspection techniques, command-line tools, and dedicated lookup utilities, you can accurately map out the tracking infrastructure of any web property.

Frequently asked questions

What is an analytics ID lookup?

An analytics ID lookup is the process of searching a website's source code or network traffic to identify unique tracking identifiers, such as Google Analytics tags, Tag Manager containers, or advertising pixels.

Can I find hidden tracking codes if a website uses Google Tag Manager?

Yes. While Tag Manager hides individual tags inside its container, you can easily spot the main GTM container ID in the source code or network traffic, which dictates which tags are deployed.

Why do some websites show no tracking IDs in their source code?

If a website loads its scripts entirely through asynchronous JavaScript, server-side tracking configurations, or strict cookie consent managers, tracking IDs may not appear in the static HTML page source.

How can I check if two different websites belong to the same owner using analytics IDs?

You can use an analytics ID lookup tool like Same Owner Websites to search for a specific tracking code. If multiple domains share the exact same tracking identifier, they are likely managed by the same entity.

Is it legal to inspect tracking codes on competitor websites?

Yes. Tracking codes and pixels are embedded in the public-facing code of a web page delivered to every visitor's browser, making inspecting them completely legal and standard practice for market research.

Related articles

Free tools