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

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.

Video: 1:14min
Click on the preview image to load and start the video from YouTube. By clicking you agree that your information will be sent to and processed by YouTube, LLC, 901 Cherry Avenue, San Bruno, CA 94066, USA. Read more

Known issues when connecting to Ad Manager

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

Your server must have the soap and openssl modules enabled to connect to your Google Ad Manager account. Otherwise, the connection will fail on the settings page.

The GAM connection can also run into a timeout if you have thousands of ad units in your account. We believe the sweet spot is somewhere between 1500 and 2000. If that is the case, then you might not be able to use the add-on.

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

Video: 02:26min
Click on the preview image to load and start the video from YouTube. By clicking you agree that your information will be sent to and processed by YouTube, LLC, 901 Cherry Avenue, San Bruno, CA 94066, USA. Read more

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 all active ad units from your account. Just click on one line to choose the ad unit.

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

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.

Google Ad Manager example of responsive ad units
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.

Video: 02:30min
Click on the preview image to load and start the video from YouTube. By clicking you agree that your information will be sent to and processed by YouTube, LLC, 901 Cherry Avenue, San Bruno, CA 94066, USA. Read more

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 specifically define the ad sizes displayed on AMP.

Options to select ad unit sizes based on the screen width or whether it displays on an AMP page.
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.

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 after making the change on the update button at the top of the Advanced Ads ad unit list in order to load the new code into the plugin.

The GAM connection can run into a timeout if you have thousands of ad units in your account. If that is the case, then you might not be able to use the add-on.

If the ad unit list stays empty then try to reconnect your Ad Manager account under Advanced Ads > Settings > Ad Manager.

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 at the same time. 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 is due to this information missing in the GAM API and has no impact on the ad’s 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 to your site, e.g., in the header. It inserts only the codes needed for the integrated ad units.

Resources

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.