What is an Ad Tag and How to Generate It [Examples Inside]
A world without ad tags would be too sterile and boring — no flashing banners, no Youtube pre-rolls, and (!) no extra revenue for you. Since we're not living in a stir-crazy ads-prohibiting dystopia, we are all able to use small yet mighty ad tags. Invisible from the outside, these chunks of code are extremely crucial in ad tech.
Just like neurons are basic working units of our brains, ad tags are core elements of digital ad serving. All the main parts of the brain contain neurons and are literally “run” by them. Similarly, publishers, advertisers, and ad networks use ad tags to exchange data with each other.
If you are just starting your advertising journey, the meaning of an ad tag may be unfamiliar to you. We've all been there, but right now, we'll help you move forward in your journey by teaching you what an ad tag is and how exactly to use it.
Let's start with the ad tag definition.
What is an Ad Tag?
Each ad tag defines exactly how the ad should be served on this particular website — it contains data about the creative ad format, size, category, and other requirements. The snippet can also be put into the header or iFrame wrapper to isolate it from the primary website script.
The Role of an Ad Tag in Digital Ad Serving
The purpose of an ad tag in digital marketing is to trigger ad requests, prompt the browser to send them forward, and sometimes, collect data about users that see the particular ad. In short, an ad tag makes digital advertising possible as we know it today.
So, here is a typical lifecycle of a placement tag:
- A publisher generates an ad tag via an ad server and places it on the web page.
- The ad tag triggers the browser to send an ad request to the publisher's ad server.
- The publisher's ad server forwards the digital tag to the data management platform to enrich it with user data for behavioral targeting. This step is optional, since not everyone uses a DMP.
- The placement tag is sent further — to the advertiser's ad server. It receives the ad tag and ships a relevant ad creative to the publisher's ad server.
- The latter finally puts the ad in the right inventory slot.
As you may have noticed, all digital advertising players use creative tags while pursuing specific goals.
Publishers need them to sell inventory to multiple advertisers and ensure that only relevant ads are shown on their websites. Ad tags allow them to serve different ads on one placement, according to the advertiser's targeting preferences.
Tags prevent errors by specifying strict creative requirements, as any occasional bug in the code may lead to a mess on the page. Remember those crappy sites with abundant ads from the 2000s? Inaccurate ad serving without ad tag usage could make content entirely unreadable.
Advertisers receive tags from publishers and use them to direct the browser to the ads that comply with the publisher's requirements. The tag also contains basic user info such as their location, browser, carrier, etc. If it was previously sent to the DMP, behavioral targeting is also possible.
Ad networks manage the whole ad serving process, so they encounter ad tags along their way from start to finish, connecting publishers and advertisers based on those creative tags. Ad networks usually use an all-in-one advertising platform to run their business. If we imagine an ad network that has direct publishers and 3rd-party advertisers, ad serving should like this:
Some publishers and advertisers prefer using ad networks — this spares them from managing their advertising campaigns on their own, although it takes away control and transparency. Ad networks generate ad tags and ask publishers to paste them. Then, they do all the matching within their ad servers and place the ads on the web page.
Types of Ad Tags and Their Examples
Sync JS Ad Tag Example:
Async JS Ad Tag Example:
Synchronous tags load simultaneously with the rest of the web page content. They'll significantly affect page load speed if something goes wrong, and the tag is rejected. The browser will keep sending requests to the server, and the page may not load at all, completely spoiling the user experience.
That is the main reason why most ad serving platforms prefer publishers who use asynchronous ad tags. The creative invoked by the ad tag will then load separately from the main content. In case of an error, the page will load as usual, but the ad will not.
<ins class="6c5773e3" data-key="001b3058ceb2d3effb32e1e548bee49c"></ins> <script async defer src="https://arsenal54.xyz/ac95016a.js"></script>
It's easy to implement for publishers, as you don't need to add cache busters to this tag, while advertisers get more detailed information on where their ads are shown thanks to the richer domain data provided by this ad tag.
- Can be used to serve ads of different sizes within a single placement;
- Are the only type of a tag used for expandable creatives;
- Puts little load on a server and are supported by the great majority of browsers;
They also have some disadvantages. For example, if the size isn't specified, the ad that appears on the website can be too large and intrusive. Moreover, the regular banner will be displayed instead of video or rich media if the user disables JS.
iFrame ad tags are separate containers of the code. They are not a part of the HTML page, but are external object elements. Here is the example of a simple iFrame ad tag:
<iframe src="http://n101adserv.com/ads?key=679c327b8adc40fe1a8e9ef4a94f1ade&ch=" width="300" height="250" frameborder="0" scrolling="no"></iframe>
These ad tags apply more restrictions to the requested creative, at the same time protecting the website from inaccurate ad serving and even malware attacks. Therefore, their benefits are:
- Size restriction which helps to keep the page's main content safe and sound;
- Content can be loaded first with the ads emerging afterward;
- Protection from intrusion to the site code and data leakage;
The known drawbacks of iFrame are accessibility issues and a possible decline in the SEO rank. Also, not all browsers support iFrame tags. Despite the fact that iFrame can't technically harm the website, publishers still don't have access to its content. Advertisers can promote malware or other forms of content you wouldn't like to appear on your website, but you won't see it — only your visitors will.
What About VAST Ad Tags?
Ad tags for video ad serving have more requirements than regular banner ad tags: they need to comply with VAST (video ad serving template), a specification defined by IAB (Interactive Advertising Bureau).
This is needed to synchronize a video player with an ad server and enable advertisers to serve ads in multiple ad inventories inside or outside these players. Thus, we have a unified protocol to serve video ads, which is more complex than banners.
VAST tags tell a video player which ad to play, what is a max video duration, is it possible to skip the ad, and when it should be displayed on the page in the case of an outstream video format. A VAST video tag can come in both URL and XML versions. The URL format is more common and it is used in the majority of ad tech platforms. XML, however, is preferable to use where available.
Here is the example of a URL VAST tag:
There are several versions of the VAST specification. The latest one is a VAST 4.0, but the VAST 2.0 and 3.0 are also operational. Moreover, the adoption pace of the newer standards is slow, so in most ad servers you can generate all of them.
Before pasting it to the website code, it's a good idea to test a video ad tag with a VAST validation tool. The ad tag tester helps you simulate the ad response from the browser and make sure the video placement tag is error-free.
Ad Tag in RTB Ad Serving
Aside from the direct ad serving we reviewed above, ad tags are used in programmatic advertising as well, but only to a certain extent. The publisher still has to embed an ad tag, which is usually generated by the supply-side platform (SSP) they're connected to. SSP's ad tags add a publisher's site to the list of the traffic sources available on this particular SSP platform.
Once the user visits the site and the tag passes the ad request to an SSP, an SSP provider or the publisher (if they use their own SSP solution) integrate the ad tag content into an RTB endpoint previously set up by a demand-side platform (DSP). DSP endpoints initiate an RTB auction by sending an ad request further to a demand-side platform (DSP).
Regular Ad Tag vs. Header Wrapper
As was mentioned earlier, you can use any kind of ad tag to utilize real-time bidding. However, the most advanced technology to sell inventory programmatically is header bidding, which can be implemented by placing a header wrapper within your page code instead of an ad tag to streamline the ad serving process.
A header wrapper is not just a tag; it's a container of tags. The advantage of a header wrapper is that you don't need to change the code to add new demand partners. If you used a single ad tag, you would need to adapt its code each time you call out a new partner.
If you use a wrapper, it collects multiple bid responses and user and performance tracking tags. It stores it in a single place and doesn't mix them up with each other. It also helps to weed out responses that are too slow by adjusting timeout settings.
Among the flaws of header wrapper compared to regular ad tags is the complex setup, compatibility issues, and even an extra fee which can be applied for when using a wrapper from a particular ad tech provider.
How to Generate an Ad Tag?
We've answered the “what is an ad tag” question. Let's move on to the most important, and surprisingly, the easiest part. How to generate an ad tag if you are an ad network? A publisher? An advertiser?
So, if you're an ad network and use an ad server like Epom, all you have to do is:
- Go to the “Publisher” tab and choose/create a publisher. For this, click on “create a new site”.
- Create a new placement zone in which your creative will belong to.
- Add a new site placement within this zone and specify its details.
- Once ready, you need to find the “Invocation Codes” tab among other settings for this placement.
- Your ad tag is now ready! Copy the chosen type of ad tag and forward it to your publisher.
As a publisher, you can do the same thing if you use an ad server for inventory selling. If you don't have one, simply ask your ad network to provide you with an ad tag and paste it into your website script.
As an advertiser that uses a 3rd-party ad server, don't worry about tag generation at all: your ad server will automatically match your creatives with the right placement tags, if the auto-linking parameters are on.
Ad Tag Summarized: All You Need to Know:
- ROLE: Ad networks generate ad tags to match publishers and advertisers. Publishers place ad tags on their websites. Advertisers serve particular ads according to the tag's requirements.
- TYPES: The most widespread is the Ins or Universal JS tag. There are also sync and async JS tags, iFrame tags, and format-specific tags that are based on standards like VAST.
- RTB: Ad tags are utilized in programmatic only by publishers and SSPs. After an SSP receives an ad request, they use endpoints to connect with a DSP.
- CREATION: Any ad network that uses an ad server can auto-generate an ad tag by creating a new placement for a publisher's website.
Ad serving software made digital advertising simple. Try the Epom ad platform to create, manage, and match thousands of ad tags in just minutes.Start Free Trial