Using the Ad Manager Tag Generator & Tester (Beta) , you can customize and generate ad tags without having to manually edit the code. The Tag Generator is suitable for all Ad Manager publishers. Some of the primary features are:
- Include custom page-level or slot-level targeting to tags
- Include custom sizes for ad tags
- Create tags for out-of-page campaigns
The Ad Manager Tag Generator & Tester (Beta) tool is provided by a third party developer and not supported or maintained by Google Ad Manager.
Define GPT and ad slot settings
- Select your tag type.
If an ad unit has both video and display ad sizes, the tag generated by the Tag Generator will contain a mix of sizes for both video and display.- Passback: Generates a passback tag to be used on third-party ad servers. Learn more
- Some of the GPT options are not available with this setting and will collapse in the setting menu.
- Passback ad tags allow you to set a click tracker URL, located in the "Ad slot(s)" section.
- Simplified URL (non JS): Generates a non-JavaScript ad call, equivalent to an
/AD/
Ad Manager legacy ad tag. Learn more- Some of the GPT options are not available with this setting and will collapse in the setting menu.
- Passback: Generates a passback tag to be used on third-party ad servers. Learn more
- Enter your network ID.
Enter custom targeting
- (Optional) Enter any page-level key-values in "Custom targeting".
- These key-values are applied to all of the ad units on the page. Learn more
- Enter the key-value as
key=value
- Multiple key-values should be separated by a comma
- If a key has multiple values, use the format
key=[value1;value2;...;valueX]
- (Optional) Enter any page level content exclusion labels.
- Line items with this exclusion label don't serve on any ad slot of the page. Learn more
Select GPT settings
- (Optional) Select any optional GPT settings
- Single request: Requests all ad slot contents in a single request. Learn more
- Out-of-page ad unit: Constructs an out-of-page (interstitial) ad slot with the given ad unit name. Learn more
- Collapse empty divs: Collapses empty div elements when there is no ad content to display. Learn more
- Disable initial load: Disables the initial fetch of ads from Google when the page is first loaded. Learn more
- Disable publisher console: Disables the Google Publisher Console on the current page. Learn more
Enter ad unit details
- Enter your ad unit name.
- Names should be in the format:
[level_1]/[level_2]/...[level_X]
- Names should be in the format:
- Enter your ad unit size(s).
- Sizes should be in the format:
[width]x[height]
- Multiple sizes should be separated by a comma
- The out-of-page ad slot size should not be defined here
- Sizes should be in the format:
- (Optional) Enter any slot-level key-values.
- These key-values only apply to this ad unit. Learn more
- Key-values should be in the format:
key=value
- Multiple key-values should be separated by a comma
- If a key has multiple values, use the format
key=[value1;value2;...;valueX]
- (Optional) Enter any slot-level content exclusions.
- Line items with this exclusion label don't serve to this ad unit. Learn more
- Click Generate Tags.
Generate and preview ad tags
When you've defined all of your settings, click Submit to generate your ad tags. The header tag and body tags will be shown separately and can be copied by simply clicking either of the "Copy" buttons.
A preview of your ads should appear.
Other features
Generate staging
You can generate an HTML test page containing the generated code and a minimal HTML structure containing the ad slot(s). To generate the staging page, simply click Generate staging after generating the tags .
The staging page can be shared via the URL and has an expiration of 30 days from the last visit. Add ?nh=true
to the URL to generate a page containing only the ad tags without any additional HTML.
Form method
You can set the form submit method to either GET
or POST
. The GET
method produces a URL that can be shared, but results in a lengthier ad call because the ad server will also receive the URL string of the request. The POST
method will result in a shorter ad call, but the request URL cannot be shared.