A web tag is a small piece of JavaScript on a website that collects data about a visit and sends it to a third-party tool, such as Google Analytics, Meta, or a heatmap vendor. Website tagging is the work of adding those tags, deciding what each one sends, and keeping them correct as the site changes.
Every analytics report, every conversion an ad platform optimizes for, and every audience you retarget starts as a request a tag sent from a visitor’s browser. If the tag is missing, fires twice, or sends the wrong value, the report is wrong, and nothing in the report tells you so.
What a web tag looks like
Most tags are a few lines you paste into the page, or that a tag manager injects for you. This is the Google tag for GA4:
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXX');
</script>
The code is not the interesting part. The request it sends is. When the page loads, the tag sends something like this to Google:
https://region1.google-analytics.com/g/collect
?v=2&tid=G-XXXXXXX&en=page_view
&dl=https://shop.example.com/pricing
&dt=Pricing
That request is called a hit. en is the event name, dl the page location, dt the page title. Every tag works the same way: it reads something about the page and the visitor, then sends it to its vendor as a URL or a payload.
How website tagging works
A page view with tags on it goes through four steps, usually in under a second:
- The page loads the tag. Either directly from the HTML, or through a tag manager container that loads many tags at once.
- A trigger decides when it fires. On page load, on a click, on a form submit, on a purchase confirmation.
- The tag reads its data. From the URL, from cookies, and above all from the
dataLayer, the object where the site publishes the values tags need: the product, the price, the order ID, the user’s consent. - The tag sends a hit to the vendor. The vendor stores it and turns it into reports, audiences, or bidding signals.
Steps 2 and 3 are where tagging goes wrong. The tag is installed, so everything looks fine. It just fires at the wrong moment or reads a variable that no longer exists.
Types of web tags
| Type | What it does | Examples |
|---|---|---|
| Analytics tags | Record page views and events for reporting | GA4, Adobe Analytics, Amplitude, Mixpanel |
| Advertising and conversion pixels | Tell an ad platform that a visitor converted, so it can attribute and optimize | Meta Pixel, Google Ads, TikTok, LinkedIn Insight |
| Consent tags | Show the banner and pass the visitor’s choice to the other tags | OneTrust, Cookiebot, Didomi, Usercentrics |
| Experience tags | Record sessions, heatmaps, or run tests | Hotjar, Microsoft Clarity, FullStory, A/B testing tools |
| Server-side tags | Receive hits on your own server and forward them to vendors | Server-side GTM, Meta Conversions API |
“Pixel” is the older name for a conversion tag. It comes from the 1×1 image ad platforms used to load before JavaScript tags took over; pixel tracking covers the difference.
Web tags vs meta tags vs HTML tags
Three things share the word, and searches mix them up all the time.
| Web tag | Meta tag | HTML tag | |
|---|---|---|---|
| What it is | JavaScript that sends data to a third party | A <meta> element in the page head | Any element of the page’s markup |
| Who reads it | Analytics and ad platforms | Search engines and social networks | The browser |
| Example | The Meta Pixel | <meta name="description" content="…"> | <p>, <a>, <img> |
| What it is for | Measurement and marketing | How the page appears in search and when shared | Structure and content |
This post is about the first column. If you are here for the <meta> description, you want an SEO guide instead.
Tag management systems
A site with five tags can live with them in the HTML. A site with fifty cannot. A tag management system (TMS) such as Google Tag Manager, Tealium, or Adobe Tags holds every tag in one container, with its triggers and variables, so marketers can add and change tags without a code release.
That speed is the point, and also the risk. A TMS makes it easy to publish a change, not to know what the change did to the data. What is tag management covers how a TMS is organized.
What goes wrong with web tags
Tags fail quietly. The page works, the visitor notices nothing, and the data is wrong for days or weeks. The usual failures:
- Missing or dead tags: a template change removes a tag from the checkout, and conversions drop to zero on one platform.
- Duplicate fires: the same purchase is sent twice, so revenue and ROAS are inflated.
- Broken triggers: a GTM release renames a variable, and the tag fires without the order ID or the value.
- Tags firing before consent: a pixel loads before the banner is answered, which is a privacy problem, not just a data one.
- Personal data in hits: an email in the URL travels to every tag that reads the page location.
Even a correct tag can lose data. In one enterprise case, the tag was right and the data still went missing because of timing: “You can have a perfectly implemented tag, in the right place, firing the right event, and still lose most of your data.” (the full story).
How to keep tags working
Checking tags in the browser, or with a tag assistant, tells you what one page sends in one session. It does not tell you what changed after Tuesday’s release.
Trackingplan works where your data is produced: the hit, the dataLayer, the SDK, the pixel, the CAPI payload, the consent state, the GTM release. It reads the requests your real visitors already send and catches missing properties, dead tags, duplicate fires, broken triggers, naming inconsistencies, and orphan events on real traffic, with links to the affected hits. More on that in monitoring.
FAQ
What is a web tag in simple terms?
A few lines of code on a website that tell a third-party tool what a visitor did, such as viewing a page or buying something.
What is tagging in web analytics?
Adding the tags that send each page view and interaction to an analytics tool, and deciding which events and parameters each one carries. The tracking plan lists them, and a tag manager deploys them.
What is the difference between a tag and a pixel?
A pixel is a kind of tag. The word comes from the invisible 1×1 image early conversion tags used. Today most “pixels”, such as the Meta Pixel, are JavaScript tags.
What is the difference between a web tag and a cookie?
A tag is code that runs and sends data. A cookie is a small file the browser stores. Tags often set or read cookies, for example to recognize a returning visitor, which is why consent rules apply to both.
Do web tags slow down a website?
Each tag adds requests and script execution. Loading tags asynchronously, through a single tag manager container, and removing the ones nobody uses keeps the cost low.
How do I know if my tags are firing correctly?
Open the browser’s network panel, or a tag debugger, and check that each tag sends a request with the values you expect. To know that stays true after every release, monitor the hits on real traffic.