Ad Tag Explained: What It Is and How to Create One

Updated on: January 9, 2024
Ad tags are the chunks of codes intended to send requests, fetch ad creatives, and facilitate the automatic placement of an ad on your site.

Ad tags are one of the essential parts of an ad campaign. But they’re not just a part of an ad campaign. They’re also crucial on any website because they help you determine how the ads are served.

That being said, a lot of learning and knowledge go along with putting up ad tags, which some publishers might need to learn about. If you want to learn more about creating your ads and getting advertisers to compete for your ad inventory, this blog will help you. I’ll dissect the importance of ad tags in advertising and explore exactly how they work.

Understanding Ad Tags

An ad tag is a piece of code that you place on your website to show ads. It sends information to your ad server and provides information on what type of ads to show, how often they should be shown, and where they should be shown.

The Role of Ad Tags in Advertising

Wondered how the little code snippet for an ad works? Let me explain.

  1. The publisher generates an ad tag using an ad server (e.g., Google Ad Manager).
  2. The ad tag contains information about the ad, such as its size, format, and targeting parameters.
  3. The publisher inserts the ad tag into their website’s HTML.
  4. When a user visits the website, the ad tag requests the advertiser’s ad server to serve an ad.
  5. The ad server receives the request. It looks for an appropriate ad to display based on factors such as the user’s location, interests, and browsing history.
  6. Once the ad server has selected an ad, it sends it back to the ad tag, which displays it on the website.
  7. The ad tag also sends information back to the publisher’s ad server, such as the number of impressions, clicks, and conversions generated by the ad. This data is used to measure the ad campaign’s performance and optimize future advertising efforts on the website.

The Different Types of Ad Tags

These two types of ad tags are used for different purposes: Synchronous and Asynchronous.

Synchronous ad tagsare traditional ones, where the ad content is loaded simultaneously with the rest of the page content. This means the page cannot fully load until the ad content is also loaded.

They work well if you want to show a single ad simultaneously. But they may be less effective if you try to show multiple ads simultaneously because they block the UI thread and can cause delays in page load times, which can negatively impact the user experience.

Asynchronous ad tags load the ad content separately from the rest of the page content, allowing the page to load more quickly. This results in faster page load times and a better user experience.

For this reason, asynchronous ad tags are generally preferred over synchronous ad tags because they provide a better user experience and can result in higher ad revenue for publishers.

How to Generate an Ad Tag in Google Ad Manager?

Creating tags for ads can be a time-consuming task. Maintaining consistency of the platform is one of the critical factors in making an efficient campaign. However, Google Ad Manager provides the functionality for quick ad tagging. This process will help you create new tags quickly*. Once you have created a new tag, you can use the tag for any campaign in the ad server.

*Prerequisite: Creating an ad tag requires the publisher to create an ad unit first.

To generate an ad tag in Google Ad Manager, follow these steps:

  • Log in to your Google Ad Manager account.
  • Go to Inventory> Ad unit. Select the ad unit for which the tag is to be created.

Ad Tag Setup

  • Select the Tags tab on the ad unit page.
  • In the next step, select the type of ad tag you want to create based on your requirements. Google Ad Manager provides three types of tags:
    • Google Publisher Tag: Used for display ad formats on the website or mobile app.
    • Mobile Application Tag: Used for mobile app ads.
    • AMP Tag: Used for display ads on AMP-enabled web pages.
    • Ad Exchange Tag: Used for display, mobile app, and in-stream video ads.
    • In that case, go for Google Publisher Tag. Once selected, you must provide details about managing the ad unit. Let me explain each field in your Ad Manager interface.
  • Passback tag: A passback tag is used when an ad impression remains unfilled (which means there’s no ad to serve on the ad inventory). Publishers often use the passback tag to serve their in-house ads.
  • Single request: This sends a single ad request to the server instead of multiple requests. Using this request mode is advisable for all publishers.
  • Empty divs: This feature enables publishers to collapse the ad space that remains unfilled by the advertiser.
  • Out-of-page creatives: The selection allows you to select various ad formats from the pop-up, floating, and pop-under ads.
  • You can Continue and generate the Google Publisher Tag for your ad unit.
  • Note that you will get a head and body tag that must be placed in their respective locations. A sample code looks like the below:
    • Head Tag:

Ad Tag Sample Example

  • Body Tag:

Ad Tag Sample Body Code

Wrapping Up

Now you know an ad tag; you can set it in your ad server. The ad tag is a vital piece of any online ad campaign and should be given as much consideration as the design of the ad itself. The goal is to make your ads stand out while being informative and practical.

Think long and hard about your target audience, what they want to know, and how you can make them take action. This is a seemingly simple task in theory, but there is a lot of nuance in practice. And for that reason, any publisher looking to get into advertising needs to put as much time and effort into their ad tag as they do their ad design work.


What Is an Ad Tag?

An ad tag is a piece of code that enables the serving of the ad and provides information such as ad size, targeting, and tracking.

What Are the Different Types of Ad Tags? 

There are four types of ad tags: Google Publisher Tag (GPT), Mobile Application Tag, AMP tag, and Ad Exchange tag.

How Does an Ad Tag Work?

When a user visits a website, the ad tag sends a request to the ad server to display an ad. The ad server selects an ad matching the targeting criteria and displays it on the page where the ad tag is placed.

News and Tips for Publishers

Get the inside scoop on publishing and programmatic with our 5-minute newsletter.