How to generate tags for multiple ad units?

Last updated: June 19, 2022 | by Kean Graham

This post was most recently updated on June 19th, 2022

Confused about generating tags? This blog post is here to help. We’ll give you some tips on how to generate tags for multiple ad units, and show you some examples of how to use them. So get ready to get creative, and start generating those tags!

In previous versions of Google Ad Manager (and its prior incarnation, DFP) it was possible to generate multiple tags from within the application itself. It is still possible to generate a single tag from within Ad Manager, but if you want to generate all the tags for one page in one go, you need to use the external tool found at dfpgpt-appspot. Despite the address, this is a Google-developed product. As of 2022, we don’t have any information about whether this will be reincorporated into Google Ad Manager at any point.

Sign in

First, go to and sign in using the button in the top right corner. Sign in using the email and password that you use for Ad Manager. You may need to allow access so that the tag generator can access your Google account.

GPT settings

In the top left box, under Google Publisher Tag (GPT) settings, enter the type of tag you want to generate and the Ad Manager network code. The current options are GPT, passback, simplified URL, and accelerated mobile pages (AMP). Unless you know you need one of passback, simplified URL or AMP, you can leave this as GPT. Click the question mark next to the box for more information on the different tag types.

The custom targeting box is where you can add any page-level key values. For example, if you want to identify the page as news, sports, technology, etc, or some other information about the page that will be passed to Google Ad Manager. The keys should be defined in Ad Manager’s Inventory -> Key values section. The format of this should be ‘key=value’, so for example you could enter category=sports in the custom targeting field and every time a request is made from the page to Ad Manager the value of sports will also be sent.

You have the option to enable single request architecture (SRA), which chooses whether all tags requests are made at once (faster to send the call but all responses need to be received before ads load).

Advanced options

This is the final toggle in the GPT settings box and allows you to change video tag, AdX/AdSense and size mapping settings, as well as some general options like centering ads, disabling cookies, collapsing empty slots, etc. If you want to get familiar with how tags are built, try generating tags with and without these options and you will see the differences between the tags. Most of these settings will add an extra line of code to the tag with a predefined command. Once you get confident with these code lines, you can add them or delete them in the future directly on your site without going back to the generator and regenerating them from scratch. All of the advanced options in the generator have symbols next to them, which explain what they do.

The responsive ad section is particularly useful, as this enables you to generate a mapping without writing the code yourself. For more information on responsive ads, see our guide here:

Ad unit specific options

Once you’ve completed your GPT settings, scroll down and there will be a box called Ad unit 1. This is the first of the ad tags you want to generate. Although this is the multiple tag generator, you can of course use it to generate just one tag, which is helpful if you want to avail of the extra settings offered.

From Ad Manager, within Inventory -> Ad units, find the ad unit code of the first ad unit that you want on your page. Copy that code into the Ad unit code box. Enter the size(s) in the generator, making sure they match the size(s) you added to the ad unit in Ad Manager.

If you’ve created a mapping in the Responsive ads box, select the mapping. We created a sample of how this might look:

How to generate tags for multiple ad units? MonitizeMore

In the Custom targeting box, you can select any ad-slot level key-value targeting. This is particularly useful if you want to pass a value such as position to Ad Manager, for example ‘top’, ‘bottom’ or ‘sidebar’.

Once you’re happy with your tagging for that ad unit, click the blue + symbol and ‘Ad unit 2’ will appear. Add more ad units as required.

Generating the tags

Once you’re happy with the settings, click the ‘GENERATE TAGS’ button at the bottom of the page, and the tags will appear at the top of the page. If you check the page URL, you’ll notice that the generator has also appended some characters. You can use this new URL at any time to return to this page.

How to generate tags for multiple ad units? MonitizeMore

You can now copy your header tag into the header section of your site, and the body tags to their appropriate position in the body section.

The generator will show live ads if you have any active line items sending ads to the ad units whose tags you’ve generated. If no ads are active, you won’t see any ads here.

You can of course make any changes to these settings by scrolling down the page and changing your settings. Have a play with the options until you’re happy with how it works.

Ready to boost your ad revenue upto 50%? Let’s talk!

How to generate tags for multiple ad units? MonitizeMore

Frequently Asked Questions

How do I create an ad tag?

To create an ad tag, sign in to GAM and click on ‘Inventory Ad Units’. Hit the ‘Tags’ tab on the desired ad unit. Pick the type of tag, you want to build and hit ‘Continue’ and customize the tag as per your needs. From ‘Tag results’, copy the tag that has been generated and embed the tag code in your web page’s source code.

Can an ad unit be in multiple placements?

Yes, Whenever you share an ad unit across multiple placements, all of the placements that contain that ad unit will appear in the placement order and line item reports if any of the placements are targeted. While this may make reporting more difficult, it may make ad inventory management easier.

Can a single ad unit have multiple sizes?

Yes, a single ad unit can have incremental sizes. You can control the order of these ad unit creatives by setting up ad units that have their original size & incrementally bigger sizes as well. So, for three sequential ad slots, you need to set up the ad units in increasing order based on their size.

Recommended Reading

AdSense Policy, News & Updates
June 13, 2024

What to do if Your AdSense Application is Rejected – A Guide

Read More
June 11, 2024

Apple Intelligence: Unlocking New Revenue Opportunities

Read More
June 7, 2024

Prep you Site for Mobile-First Indexing before July 5th

Read More

Trusted by 1,500+ publishers worldwide

10X your ad revenue with our award-winning solutions.

Let's Talk


Ready to 10X your ad revenue with the #1 ad management partner?

Start Now