Google Ad Manager Integration Manual

This is the manual of our Google Ad Manager Integration for WordPress.

Connect to your Ad Manager account

Enable the API in Google Ad Manager

Before connecting your site to Google Ad Manager, you need to enable the API access option in your account.

  • log in to your Google Ad Manager account
  • go to Admin > Global Settings > Network Settings > General Settings
  • enter a value in the Display name field
  • enable the API access option
  • Click on Save (In truth, it is easy to miss at the bottom of the page)

Find the API access option in the Admin settings and enable it.

Afterward, you should be able to connect to the API in a few minutes.

Connect your site

You need to connect the Google Ad Manager integration to your account to load the ads from it.

  • go to Advanced Ads > Settings > Google Ad Manager
  • click on Connect account
  • choose the Google account your Ad Manager is hosted with
  • confirm the connection
  • if you receive the error that the API needs to be enabled, follow these steps and reload the settings page again

The connection between your GAM account and your site should be active now.

Importing ad units automatically

After connecting to your Google Ad Manager account, you will find an Import button in the GAM settings in Advanced Ads when your Ad Manager account contains ad units that are not yet imported within Advanced Ads.

The option allows you to import all or specific ad units into Advanced Ads ads.

List of ad units with a checkbox that allows users to import them automatically into WordPress.
Import all or some ad units automatically.

The imported ads are not showing up on your website right away. You can still choose where to display them.

Known issues when connecting to Ad Manager

If the connection suddenly stops working, go to Advanced Ads > Setting > Ad Manager and re-connect. If this happens repeatedly, then please let us know.

If you cannot select your Google account or receive a warning (e.g., Error 400), go to and log in there. Now, refresh the Ad Manager connection settings and try again.

Using Google Ad Manager ads

The plugin creates a new ad type called “Google Ad Manager” in Advanced Ads.

When selected, the Ad Parameters box will list the available ad units. When your GAM account has fewer than 50 ad units, all ad units will be loaded after connecting to your account and be visible in the list.

If the account contains more ad units, you can use the search field to add individual ad units to the list.

Google Ad Manager – highlight the button to search for ad units
Search for ad units from your Google Ad Manager account.

Whether your GAM account contains more or less than 50 ad units, new ad units are added using the search button next to the ad unit list.

Search for Google Ad Manager ad units with the string “Native” in their title and show two results.
Search for ad units with “Native” in their title.

Ad units need to be activated in your GAM account to show up in the list of available ad units.

You can update or remove individual ad units from the list using the appropriate buttons.

Delete or update individual ad units.

The update option checks if the ad unit has changed in your Google Ad Manager account. The most common cases are changes in ad sizes.

The delete option helps to keep the ad unit list short and relevant to used ads. If you remove an ad unit still used in another ad, it will continue to work and show a warning on the ad edit page.

Removing an ad unit from the ad edit page does not affect it in your Google Ad Manager account.

Ad Sizes

The Ad Sizes option allows you to show different ad unit sizes for different screen widths. For this purpose, Advanced Ads will automatically pull the available sizes from the ad unit setup in your Ad Manager account.

Example of using responsive ads with Google Ad Manager. Set various ad sizes depending on the screen size.
Choose which ad sizes to display for which screen size.

Enable the Automatic filter option to consider only ad sizes that fit the container’s width in which you place the ad.

Ad sizes on AMP

When you have a plugin installed that generates AMP (Accelerated Mobile Pages) then you will find an additional AMP pages option under the Ad Sizes. It allows you to define the ad sizes displayed on AMP specifically.

Selecting specific ad sizes on AMP pags.
Select ad unit sizes for AMP pages.

This option also allows you to disable a specific Google Ad Manager ad unit on AMP pages by disabling all checkboxes.

The “fluid” ad size works on AMP when placed below the fold. Google told us that they might change this in the future.


This option allows you to reload Google Ad Manager ad units in the same spot. 

Before you proceed with the auto-refresh, it is crucial to declare which portions of your inventory refresh and to enable your inventory to compete on Ad Exchange.

If you set the auto-refresh to the default value of “0”, the function is disabled. We recommend a refresh interval of 15-30 seconds.

Auto-refresh option for Google Ad Manager ads
You can optionally set a refresh interval for Google Ad Manager ads

Key-Value Targeting

Basically, key-values targeting allows you to deliver ads based on specific information from your site, like the post category, the ad’s position, or user information.

Google Ad Manager example of key-values
Add key-values targeting without touching any code.

Find more information about this feature in this documentation and more about key values in Google’s Manual.

Notes on the key-values feature

  • Key-values are not sent on AMP pages, yet
  • The option uses “slot-level” targeting, meaning that key-values are set up for each ad unit individually
  • The Post Meta and User Meta conditions work with simple values, not serialized strings containing arrays
  • Many key-values that are based on WordPress, like User meta would not work when AJAX Cache Busting is used. You usually don’t need Cache Busting for GAM ads. But in case you do, double-check if key-values targeting is working correctly using the GAM Publisher Console

Known issues when loading ad units

Ads set up as “Smart Banners” in Google Ad Manager are not showing up in the ad list since they are for Mobile Apps and not for websites.

If you add new ad sizes to your ad units in your GAM account, click 30 minutes later on the update button next to the ad unit to update it in the plugin.

Collapsing ad units

Set the Collapse empty elements option under Advanced Ads > Settings > Google Ad Manager to define how ad space should behave if ads are not loaded into them.

  • Do not collapse – reserves the ad space and even keeps it when no ad was loaded from GAM. We recommend this if your ad space always delivers ads and you want to prevent your content from jumping in case an ad is missing.
  • Collapse if empty – reserves the ad space and collapses it after GAM did not fill it.
  • Fill space when the ad is loaded – no reserved ad space. It only fills the space when GAM has an ad for it.

What else you need to know

You might run into conflicts when using the traditional, manual method of implementing head and body tags from GAM with our Google Ad Manager integration simultaneously. The most common issue is using the same ad units in both methods.

Our Google Ad Manager plugin uses inline tags, which don’t need matching head and body codes, and is flexible when delivering different ad units to different users. If you depend on using the Roadblock or SingleRequest options for GAM, use the manual setup for Ad Manager tags.

We store all relevant ad unit information with the ad created in Advanced Ads. This store keeps the ad working even when you connect your site with a different Google Ad Manager account or disconnect it completely.

The ad container ID created by Advanced Ads is different from the one in the GAM account. It changes with each page reload if your site is not cached.  This has no impact on the ads’ functionality. We are following the same format, though, e.g., gpt-ad-523415610-0.

The add-on can connect to your GAM account whether your site uses HTTP or HTTPS, though we highly encourage using the latter.

The Ad Manager plugin does not place any additional codes on your site, e.g., in the header. It inserts only the codes needed for the integrated ad units.


Google Ad Manager is a product by Google. Please notice that we can only support our Google Ad Manager Integration and not help with settings within your actual GAM account.

If the manually placed ad unit is showing up, then please check out the general issues for ads not showing up and reach out to our support if that doesn’t help.

If the ad unit is not showing up, you might find the answer in our Google Ad Manager Debug guide.

Changes made in your Google Ad Manager account can take time until they are visible on your site. We find that only after 30 minutes you can be sure that your change should be visible on your site.

If you made a change on your site and not in your Google Ad Manager account, make sure to clear your website cache.

While the same ad units can be used multiple times on a page, you would need to make sure that the following is true:

  • Every creative can only be displayed once per page. If you want to deliver it multiple times, you would need to duplicate the creative multiple times in the line item and check out the next suggestion on this list.
  • By default, a line item only delivers one creative per page. If you have multiple ad units delivering ads from the line item, only one will show an ad. If you have multiple creatives in the same line item, you must set the option Adjust delivery > Display creatives in the line item’s settings to “As many as possible”.

When using Google AdSense ads through Google Ad Manager, the ads can be smaller than when placing the AdSense tags directly on your site. This happens because Google Ad Manager ad units have fixed sizes and don’t expand as dynamically as responsive AdSense ads do.

The solution is either to create bigger sizes of the Google Ad Manager ad units that contain the AdSense ads or place AdSense ads directly on your site.

In most setups, ad units need to have sizes assigned to deliver ads. Go to Inventory > Ad units in your Google Ad Manager account and check if you find values in the Sizes column.

All sizes that could be visible on your website must also be attached to the ad unit’s code.

E.g., the following line of code from an ad unit could show a 728x90 leaderboard or 336x280 medium rectangle.

googletag.defineSlot('/1234567890/mixed-group', [[336, 280], [768,90]], 'div-gpt-ad-987654321-0')Code language: JavaScript (javascript)

The next code is completely missing ad sizes. Maybe this happened because the code was manipulated, or the ad unit does not have sizes assigned in your Ad Manager account. Set up sizes and update the code to resolve it.

googletag.defineSlot('/1234567890/mixed-group'[],'div-gpt-ad-987654321-0')Code language: JavaScript (javascript)

The following line would only deliver a leaderboard, since the size for the medium rectangle is missing in your code.

googletag.defineSlot('/1234567890/mixed-group', [768,90], 'div-gpt-ad-987654321-0')Code language: JavaScript (javascript)

If you have set up the correct sizes in your Ad Manager account then you can just update the ad code on the ad edit page when using our Google Ad Manager integration.

Check the following suggestions if your ad unit is set up with specific sizes, e.g., 300×250 and 468×60, but an ad with a bigger size is displayed on your site.

  • Open the Google Ad Manager debug mode by adding ?googfc to the URL.
  • Look for the ad with the wrong sizes

If the “Slot size” information returns the ad unit sizes you set up to be delivered, then the issue is within your Ad Manager account setup. go through the line items and creative settings to find the cause.

Example of Google Ad Manager ad unit sizes

If the Slot size information on your site is wrong then the problem is with the ad unit code on your site. A couple of common causes are:

  • a missing or wrong ad size in the ad unit code, see Ad units are missing sizes for more information
  • a missing or wrong information in the sizeMapping array
  • using sizeMapping with the same sizeMapping array assigned to different ad units

Google Ad Manager can extend certain ad types (currently display and out-stream video) to fit the full width of a device. E.g., it would scale a 300×250 ad to 360×300 on a device with a width of 360px. This is a feature, not a bug. You can learn more about it from their manual.

Make it better

Increase your ad management skills without spending more time.
Join over 150,000 publishers and AdOpts increasing their ad revenue.