3.2 How to Generate Ad Tags in Google Ad Manager for Your Website Quickly and Accurately

Understanding Ad Tags in Google Ad Manager

Ad tags are essential pieces of code that help display ads on websites. They work by connecting the website’s ad slots to an ad server, which then delivers the appropriate ads.

Understanding how ad tags function and what makes up their code is key for both publishers and advertisers to ensure ads show correctly and generate revenue.

What Are Ad Tags?

Ad tags are snippets of JavaScript or HTML code inserted into specific locations on a web page. Each ad tag corresponds to an ad unit or ad slot, which is a designated space where an ad will appear.

When a visitor loads the webpage, the ad tag makes an ad request to the ad server, signalling it to return an ad. This allows the publisher to control where ads show based on page layout.

Ad tags are vital because they ensure ads load dynamically without changing the page’s code manually for every ad. Publishers can generate multiple ad tags for different kinds of ads like display ads, video ads, and mobile ads.

Each ad tag is customisable to match the ad format and targeting needs.

How Ad Tags Operate Within Ad Serving

When a user visits a site, the ad tag embedded in the webpage sends a request to an ad server, such as Google Ad Manager. The ad server checks which ads are eligible to display based on targeting information, budgets, and campaign rules from the advertiser.

Once the ad is selected, the ad server sends the specific creative (the ad content) back to the ad tag’s slot. The browser then renders this ad within the allocated space on the page.

This process happens quickly and often involves real-time bidding where multiple advertisers compete for the same ad slot. The ad tag ensures the correct ad loads in the right place at the right time.

Key Components of Ad Tag Code

Ad tag code usually consists of several important parts:

  • Ad unit path: Identifies the specific ad slot or unit tied to the publisher’s inventory.
  • Size parameters: Define the width and height of the ad space.
  • JavaScript snippet: Handles the communication between the webpage and the ad server.
  • Key-values (optional): Used for targeting based on audience or content category.

Below is a simplified example of key components in a Google Publisher Tag:

googletag.cmd.push(function() { googletag.defineSlot('/1234567/homepage', [300, 250], 'div-gpt-ad-123456789-0').addService(googletag.pubads()); googletag.enableServices(); });

This code includes the ad unit path, the dimensions of the ad slot, and the container where the ad will show. Proper implementation of these elements ensures the ad tag functions as intended.

Preparing Your Website for Ad Tag Implementation

Before adding ad tags, the website must be properly set up to host advertisements. This involves planning the placement of ad slots in the site’s HTML and ensuring the layout supports the display of varied ad units without disrupting user experience or content flow.

Placing Ad Placeholders and Divs

Ad placeholders, often called ad slots or divs, are sections within the website’s HTML where ads will appear. Each ad slot needs a unique ID or class to help Google Ad Manager identify and fill it with the appropriate ad unit.

Publishers must insert these div elements carefully into the page’s code. The placeholders should be sized according to the expected ad format, such as banner, rectangle, or leaderboard.

Incorrect sizing can cause ads to display poorly or break the page layout. It is essential to keep ad placeholders separate from core content sections.

This prevents ads from interfering with navigation or readability. Using clear comments in the HTML around each ad slot can help future updates or troubleshooting.

Aligning Ad Units and Website Structure

The ad units created in Google Ad Manager should match the size and type of the ad slots on the website. If an ad unit’s dimensions do not align with its corresponding placeholder, ads may not show up or could appear distorted.

Publishers need to consider the overall site structure when planning ad placement. Ad slots should be positioned where they get visibility but don’t distract users from the main content.

Common areas include sidebars, headers, footers, and between paragraphs. Testing different placements helps determine the best balance between revenue and user experience.

The site’s CSS may require adjustments to support fixed or responsive ad units, ensuring ads adapt to different devices and screen sizes. For detailed implementation, consulting guides on how to properly create ad tags in Google Ad Manager can provide step-by-step support.

Generating Ad Tags in Google Ad Manager

Creating ad tags in Google Ad Manager involves a few clear steps that ensure the proper delivery and tracking of ads on a website. The process starts with selecting the right ad unit and ends with placing the generated code on the site.

Each part must be done carefully to match the publisher’s setup and maximise ad performance.

Navigating to Ad Units and Inventory

The first step is to access the Ad Units section within the Google Ad Manager interface. Publishers find this under the Inventory tab where all existing ad spaces are listed.

An ad unit represents a specific area on a website where ads will appear, so it’s important to select the correct one or create a new unit if needed. The interface allows finding ad units quickly by filtering through site sections or sizes.

This helps publishers manage multiple units across different pages. The layout also shows details such as the unit’s name, size, and status, which helps verify correct targeting before generating tags.

Selecting Tag Types and Options

Once the ad unit is selected, the next step is choosing the tag type. Google Ad Manager supports various tag formats like Google Publisher Tag (GPT) for standard display ads or VAST tags for video ads.

Publishers decide depending on the ad format and technology used on their site. In this phase, it’s possible to enable single request architecture (SRA), which optimises ad loading by combining ad requests.

Other options include setting custom sizes or targeting parameters, which refine when and where ads show. These settings affect both delivery speed and ad relevance.

Copying and Placing Generated Code

After configuring tag options, Google Ad Manager generates the ad tag code. This code snippet must be copied exactly as shown to avoid errors.

Publishers usually place it in the website’s HTML or through a tag manager system. For best results, the code goes into the precise location on the page that matches the ad unit’s intended position.

This ensures ads load correctly and track impressions. It is also important to test tags after placement to confirm ads serve properly and data flows back to the Ad Manager system.

More detailed instructions on creating ad tags can be found on how to generate ad tags in Google Ad Manager.

Types of Ad Tags and Their Impact

Ad tags play a key role in how ads load and perform on websites. Choosing the right type of ad tag affects page speed, user experience, and how effectively ads generate revenue.

Different tags interact with ad servers and networks in specific ways, impacting ad delivery and tracking.

Synchronous Versus Asynchronous Ad Tags

Synchronous ad tags load one after another, which means the browser waits for each ad to fully load before moving on. This method can slow down website loading times because the page waits on the ad server.

While easier to implement, synchronous tags can cause delays in page content displaying, which may frustrate users. Asynchronous ad tags load independently of the main page content.

They allow the page to load without waiting for ads to finish loading. This improves user experience as pages appear faster, even when ads take longer to load.

Asynchronous tags are preferred for modern online advertising because they reduce blocking and help maximise ad revenue by not slowing down the site.

FeatureSynchronous Ad TagAsynchronous Ad Tag
Load orderOne by oneParallel with content
Page speed impactSlowerFaster
User experienceCan delay page displayPage loads uninterrupted
ComplexitySimple to implementSlightly more complex

Third-Party Ad Tags and Passback Tags

Third-party ad tags come from ad networks or external ad servers rather than the publisher’s own ad server. These tags allow publishers to display ads from multiple advertisers and networks.

They are essential for expanding ad inventory but can sometimes slow down page performance if the third-party servers are slow. Passback tags are used when an ad network cannot fill an ad request.

The passback tag sends the request to a secondary ad network or the publisher’s own ad server to try again. This increases the chance of filling ad space, maximising ad revenue.

Passback tags ensure no ad space goes unused but require proper setup to avoid conflicts or slow load times. Both third-party and passback tags are important tools for publishers managing complex ad setups and aiming to optimise revenue from multiple sources.

Advanced Tag Options and Features

Google Ad Manager offers settings that enhance ad delivery and improve user experience on your website. These settings control how ad requests are handled, how empty ad slots behave, and how ads are targeted to specific users or contexts.

Enabling Single Request Mode

Single Request Mode lets Google Ad Manager send one combined ad request for all ad slots on a page. This reduces the number of server calls, lowering latency and speeding up page load times.

Using this mode helps improve ad engagement since ads load faster and reduce delays that may cause users to lose interest or leave the page.

It also cuts down on network traffic, which can benefit sites with many ad units. However, it may limit some real-time targeting or reporting features you get with multiple requests.

Single Request Mode is best when your website performance is a priority and you have standard targeting needs across ad slots.

Managing Empty Divs and Collapsing

Empty ad slots, or empty divs, can create unnecessary space on a page if an ad isn’t available to display. Google Ad Manager allows publishers to collapse empty divs automatically, removing this blank space.

Collapsing helps keep the page layout clean and avoids distracting gaps that hurt user experience. It also prevents content from shifting unexpectedly when ads load or fail.

Publishers can control this at the inventory unit level, deciding which slots should collapse or remain to hold their place. This fine control helps balance ad visibility and page design.

Utilising Key-Values and Targeting

Key-values are custom parameters added to ad requests allowing precise inventory unit level targeting. They let publishers pass extra information about users or page content to tailor which ads appear.

For example, key-values can specify user categories, content categories, or ad formats. This improves ad relevance, boosting click rates and advertiser satisfaction.

Advertisers use these parameters to bid more competitively on valuable impressions. Properly setting key-values requires coordination between the publisher’s website code and Google Ad Manager’s setup to ensure accurate targeting and reporting.

Integrating Google Ad Manager Tags with Google Tag Manager

Integrating Google Ad Manager (GAM) tags with Google Tag Manager (GTM) helps streamline ad deployment and improve control over ad units on a website. This process involves setting up GTM, creating tags within it, testing their function, and optimising delivery with advanced techniques like lazy loading and viewability tracking.

Setting Up Google Tag Manager for Ad Deployment

The first step is to add Google Tag Manager snippets to every page where ads will appear. These snippets load GTM’s JavaScript container, allowing tags to be managed without directly changing the website’s code.

Next, configure the GTM container to hold the Google Ad Manager tags. This includes creating variables and triggers to define when and where ads should load.

Ensure proper permissions and environments are set up inside GTM so changes can be tested before publishing. This reduces errors in live campaigns.

Creating and Configuring Tags within GTM

In GTM, users create new tags to deploy Google Ad Manager ad units. When configuring these tags, they select “Custom HTML” or an official “Google Ad Manager” tag template, if available.

Each tag must include the Ad Manager’s ad slot code, which identifies the ad unit and specifies its size and placement. Variables like page URL or user attributes can be passed for targeting.

Triggers control when tags fire—common triggers include page views for loading ads when a page opens. Custom triggers can fire tags during specific user actions or conditions.

Tags can be organised and tested within GTM’s workspace. This allows easy editing and version control.

Testing and Troubleshooting Tag Delivery

Testing is vital to confirm ad tags fire correctly. GTM provides a debug mode to preview tags on your website without affecting live traffic.

During testing, check if the correct ad slots load without errors. Use browser developer tools to monitor the network requests and verify ad calls and responses.

If ads fail to appear or load slowly, check for conflicts with other scripts, missing container snippets, or trigger misconfigurations.

Clear communication between Google Ad Manager and GTM is necessary to make sure targeting, refresh rates, and frequency capping function properly.

Implementing Lazy Loading and Viewability Tracking

Lazy loading improves page load time by delaying ad loading until the user scrolls near the ad slot. In GTM, this can be done by setting triggers based on scroll depth or viewport visibility.

Viewability tracking ensures ads are only counted when visible to users. GTM can integrate viewability pixels or scripts that send data back to Google Ad Manager or analytics platforms.

Both lazy loading and viewability tracking help improve user experience and revenue by targeting ads effectively and reducing unnoticed impressions.

These features also assist in running more precise A/B testing by controlling when ads load and measuring actual engagement.

Optimising Ad Performance and Revenue

To boost ad revenue, publishers need to focus on how ads impact user experience, track engagement metrics, and test different ad setups. These actions help fine-tune ad delivery and make sure advertisers get better results while users stay satisfied.

Improving Page Load Time and User Experience

Fast-loading pages keep visitors on a site longer and reduce bounce rates. Slow ads can delay page loading, which harms user experience and lowers ad revenue.

Using asynchronous ad tags allows the rest of the page to load without waiting for ads. Limiting the number of heavy or large-format ads also helps maintain speed.

Publishers should avoid too many pop-ups or auto-play videos as these can frustrate users. Optimising images and scripts related to ads reduces latency.

Google Ad Manager offers settings to prioritise faster ad formats and minimise page slowdowns. Keeping page load time below 3 seconds is a good target to balance ad visibility and user satisfaction.

Measuring Ad Engagement and CTR

Tracking Click-Through Rate (CTR) is essential for understanding how well ads perform. A higher CTR means more users interact with ads, attracting more advertisers and potentially increasing revenue.

Ad engagement can also be measured by impressions, viewability, and conversion metrics. Google Ad Manager’s ad tags send this data back to the platform, allowing publishers to monitor which ad units perform best.

Publishers should analyse which ad formats drive clicks and keep users engaged without disrupting content. Testing different ad placements or sizes can reveal what appeals most to users and delivers higher CTR.

Conducting A/B Testing for Ad Effectiveness

A/B testing in Google Ad Manager involves comparing two versions of an ad setup to see which performs better. This might include testing different ad formats, placements, or creative content.

Running experiments helps identify which ads generate more clicks or revenue while maintaining a good user experience. It also allows the optimisation of bidding strategies and targeting options.

Ad variations should be tested over enough time and impressions to get reliable results. Publishers can then use these insights to adjust tags for better ad engagement and increased earnings.

For more details on optimising and testing ads, see the guide on optimizing your Google Ad Manager campaigns.

Save yourself a fortune in monthly costs. Get the ProofMEDIA Suite for your self-hosted WordPress site. Here’s what it does

💖 Ready to become a ProofMEDIA Agency Partner?

Schedule a Call