An ad tag is a small snippet of code — usually HTML or JavaScript — placed on a publisher's website or app that defines where an ad should appear and instructs the browser to request and display a creative in that location. When a user loads the page, the ad tag fires, sending a request to the ad server or supply-side platform, which returns the appropriate ad to fill the slot. In effect, the ad tag is the connective tissue between a publisher's inventory and the advertising technology that monetizes it.
Each ad tag specifies the parameters of the placement: the slot's dimensions, the ad format (banner, video, native), the page URL, and often additional data like device type, user identifiers, or contextual signals. These parameters travel with the ad request so the ad server or SSP can match the right creative to the right impression. Without accurate tags, the wrong-sized ad might serve, tracking could break, or the slot might go unfilled.
There are several types of ad tags. A standard ad tag requests a single ad for a fixed placement. A passback tag tells the system to "pass back" an unfilled request to another demand source — the mechanism behind the traditional waterfall, where inventory cascades from one partner to the next until it's sold. A VAST tag is a specialized ad tag for video that returns an XML response telling the video player how and when to load the ad.
For publishers, correct tag implementation is foundational to revenue. Misconfigured tags cause discrepancies between the impressions a publisher believes it served and what advertisers report, eroding trust and payment accuracy. Tags also carry the targeting and floor-price information that determines how competitively each impression is monetized.
For advertisers, third-party ad tags allow creatives and tracking to be served from the advertiser's own ad server, ensuring consistent measurement and creative control across many publishers. This independence is why agencies typically traffic campaigns using their own tags rather than handing raw creative files to each publisher.
Ad tags also raise quality and security considerations. Because they execute code in the user's browser, poorly vetted tags can introduce latency, malware, or unwanted redirects. Reputable platforms scan tags and creatives to protect users and preserve brand safety. Properly built and tested, the humble ad tag is what makes automated, measurable, scalable ad delivery possible at the level of every individual placement.