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!
Overview of Ad Tags
Ad tags are snippets of code that allow your website to request advertisements from an ad server. They contain essential information about the ad, such as its size, format, and targeting parameters. Properly configured ad tags ensure that the right ads are displayed to the right users, enhancing both user experience and revenue potential.
Steps to Generate Tags for Multiple Ad Units
1. Accessing the Tag Generator
To begin generating tags, follow these steps:
- Sign In: Go to Google Ad Manager and sign in with your credentials.
- Navigate to Inventory: Click on Inventory in the left panel, then select Ad Units.
2. Using the External Tag Generator
While GAM allows for single tag generation within the application, generating multiple tags requires an external tool:
- External Tool: Visit dfpgpt.appspot.com to access the Google-developed tag generator.
- Sign In: Use your GAM credentials to sign in. You may need to grant permissions for the tool to access your account.
3. Configuring Google Publisher Tag (GPT) Settings
Once signed in, you’ll configure your GPT settings:
- Tag Type Selection: Choose the tag type you want to generate—options include Google Publisher Tag (GPT), passback tags, simplified URL, and AMP tags. For most cases, select GPT.
- Custom Targeting: Use the custom targeting box to add key-value pairs that define page-level targeting (e.g.,
category=sports
). Ensure these keys are pre-defined in GAM under Inventory > Key Values. - Single Request Architecture (SRA): Optionally enable SRA for faster ad loading by making all tag requests simultaneously.
4. Adding Ad Units
After configuring GPT settings:
- Ad Unit Configuration: Scroll down to the Ad Unit 1 section. Here, you can input details for your first ad unit:
- Ad Unit Code: Copy and paste the ad unit code from GAM.
- Sizes: Enter the dimensions that match those specified in GAM.
- Adding More Ad Units: Click on the blue plus (+) button to add more ad units as needed. Repeat the configuration for each unit.
5. 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 directly on your site in the future 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: https://www.monetizemore.com/blog/what-are-responsive-ads/.
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:
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.
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.
Test your ad tags across various devices and browsers to ensure they function correctly and comply with industry standards.
Of course, you can make any changes to these settings by scrolling down the page and changing your settings. Play with the options until you’re happy with how they work.
Ready to boost your ad revenue upto 50%? Let’s talk!
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.
With over seven years at the forefront of programmatic advertising, Aleesha is a renowned Ad-Tech expert, blending innovative strategies with cutting-edge technology. Her insights have reshaped programmatic advertising, leading to groundbreaking campaigns and 10X ROI increases for publishers and global brands. She believes in setting new standards in dynamic ad targeting and optimization.