🥳 You have completed all topics in the Handbook. Click here to claim your certificate!

1. What are tags?

In digital marketing, "tags" refer to HTML elements specifically used for collecting data to marketing vendor servers. Due to historical reasons, "tags" are sometimes used interchangeably with "pixels".

“Tags”, in the context of the web in general, are HTML elements that form a web page. Each individual element (or node) is represented in the HTML markup by a tag.

In the context of marketing technologies, “tags” denote HTML elements specifically designed for collecting data to marketing vendors’ servers.

A web page in itself is not a tracking tool. Even though some navigation data is automatically logged by web servers when you visit a web page, the act of tracking from the point of view of marketing technologies always requires manual work.

When you start working with a marketing technology vendor, they’ll instruct you to deploy their tags on your sites and your apps.

Some of these tags work autonomously, which means that just by virtue of deploying a single tag the vendor can automatically collect information about your visitors.

But in most cases, you’ll need to manually configure the tags to make sure that they collect all the relevant information.

The more autonomous the tracking, the more problems it creates from data minimization and data protection perspectives. It’s imperative that if you are in charge of deploying tags, you should have full control over what the tags collect, when they collect the data, and who they collect the data from.

Deep Dive

Scripts and pixels

Before JavaScript became the main marketing technology of the web browser, marketing tags were also called pixels. This is because the image tag (<img>) was often deployed as a single pixel so that it would be as invisible and unobtrusive as possible. A single pixel represents a point on the screen. For example, any character in the text you are currently reading comprises multiple pixels.

Later, when tracking platforms became more sophisticated, their JavaScript libraries were loaded on the page with script tags (<script>). These load JavaScript files from third-party sources, such as a vendor’s content distribution network (CDN). Once the files have been loaded, the code within these files (also called libraries) is run by the browser, and this initiates the tracking and data collection processes.

The anatomy of a “tag”

But how do tags work? What is special about the snippets of code that allows these technologies to harvest data from website visitors?

As mentioned above, tags are actually HTML elements that can be added directly to the web page source code. They can also be deployed through JavaScript snippets, for example with the help of a Tag Management System (TMS).

Regardless of the method of deployment, once the tag has been deployed, the web browser proceeds to render the contents.

This act of rendering might cause the tag to generate a network request to the vendor’s collector server (in the case of image and script tags) or to execute additional JavaScript commands in the user’s browser.

The purpose of any marketing tag, ultimately, is to inform the vendor’s web server that something happened on the web page. This dispatch typically comprises an event and its associated metadata.

Example eventTypical metadata
Page ViewPage URL, Page Title, Page ID
Registration / LoginUser ID, Registration / Login Method, User Status
PurchaseOrder ID, Total Value, Cart Quantity

By informing the vendor, the company sending the data can then utilize the vendor’s reports and tools to perform many of the tasks that fall under the technical marketing umbrella:

  1. Analytics – for a better understanding of how users browse and digest the content.
  2. Advertising – to know how well the company’s ads perform against key target metrics (conversions).
  3. A/B testing – to test different variations of a page or its elements.
  4. Search Engine Optimization – to annotate the page with structured data so that search engine crawlers would find it easier to understand what the page is about.

This, then, is the purpose of tagging a website. To understand better how the vendor’s technology can help a company achieve its goals, the company must send data to the vendor. To do this, they need to deploy the vendor’s tags.

Your task as a technical marketer is to understand that tags are foreign code – they are rarely necessary for the site to function, so the overhead that they introduce needs to be compensated somehow.

Deep Dive

Tracker examples

This is an example of typical tracking-related HTML.

<img src="https://collector.adnetwork.com/?id=gc112_bd44" />
<script src="https://www.tracker-cdn.com/tracker.js"></script>
  (function() {
    var id = Math.random();
    var tracker = new DataTracker(id);
    tracker.trackPage('/', 'My Home Page');

The <img> tag sends a network request to the address https://collector.adnetwork.com/?id=gc112_bd44.

The first <script> tag loads a JavaScript file (tracker.js) from https://www.tracker-cdn.com.

The second <script> block creates a new tracker instance with a random identifier, which is then used to track a Page View event.

All three of these approaches are utilized by marketing technology vendors to gather information from a website.

Tags are foreign code

Particularly with regulatory scrutiny in a post-GDPR world, it is important to understand that tags running in the web browser often collect far more data than you expect.


When a vendor’s JavaScript library is loaded on the page with a <script> tag, that JavaScript can freely execute and run its code in the visitor’s browser.

When an image request is sent to vendor servers, that request contains a lot of information in the request headers, such as the IP address of the user and data about the web browser and device they are using.

In other words, when you deploy a tag, you need to be mindful that it collects data about the user, often without the user being at all aware that this type of data collection is taking place.

Because of the nature of marketing technologies, particularly on the web, it’s often impossible to be absolutely sure that only the necessary data is being collected.

Key takeaway #1: “Tags” aren’t just tags

The origins of the word “tag” is rooted in HTML, where a pixel or script library was represented by an HTML tag. Nowadays, a “tag” represents a complicated, multi-layered tracking infrastructure that’s loaded on the site via JavaScript libraries and dispatches requests in a multitude of different ways – not just with small image files.

Key takeaway #2: Browsers are generous in what data they offer

Tags running on a web page can access a huge amount of information. Page URL, previous page URL, text content on the page (email addresses, phone numbers…), information in the data layer, information in first-party cookies… Browsers don’t really offer a way to prevent this access – once a tag is loaded on the page, it can utilize this data without restriction.

Key takeaway #3: Tags are foreign code

When you load a third-party tag on a web page, the company that built the tagging library can run whatever JavaScript they want on the page. Due to how the browser works, this JavaScript can access all the information you want it to access and then some. It’s not unheard of to have borderline malicious tags scrape everything in the first-party cookie space and send it unencrypted over the network. Always validate, verify, and vet the vendors you work with. Never deploy a tag you are not sure of how it works.

Quiz: What Are Tags?

Ready to test what you've learned? Dive into the quiz below!

1. What does "tags are foreign code" mean?

2. Why are autonomous trackers problematic?

3. Which of the following tags is NOT typically used to send data to a vendor?

Your score is


What did you think about this topic?

Thanks for your feedback!

Unlock Premium Content

Simmer specializes in self-paced online courses for technical marketers. Take a look at our offering and enroll in one or more of our courses!

Online course

Server-side Tagging In Google Tag Manager

Learn everything you need to know about server-side GTM in our flagship course!