Google Ad Manager (formerly DFP) - How to create ad codes for newsletter shortcodes
This is a Knowledge Base (KB) article on how to incorporate Google Ad Manager (formerly DFP) Ads into newsletter shortcodes.
IMPORTANT NOTE: If you are using MailChimp it is not recommended to use Google Ad Manager (formerly DFP) Ads in your newsletters, you will need to disable click tracking for your newsletter issues (known as Campaigns in MailChimp) for the Ad links to work in MailChimp. See the section at the bottom of this KB article to learn how to disable click tracking in MailChimp via a Rendering Option (RO).
First, you will be sure to properly setup your Ad Unit in Google Ad Manager (formerly DFP). Here is a helpful KB article on that.
IMPORTANT NOTE: Your Ad Unit must be Active, you can find the status of the Ad Unit in Google Ad Manager under Inventory > Ad Unit, then select the specific Ad Unit where you will see if it is Active or InActive (Example: Active below).
Once the Ad Unit is setup properly and its status is active, use the [newsletter-ad] shortcode in an Editorial Content (EC) Area that will be used in a Rendering Option (RO) for your newsletter. The ad code (URL) should follow the pattern below:
[newsletter-ad template="bg-white"]<a href='https://pubads.g.doubleclick.net/gampad/jump?iu=/61021078/test_ad_unit&sz=728x90&c=[TIMESTAMP]' target='_blank'><img src='https://pubads.g.doubleclick.net/gampad/ad?iu=/61021078/test_ad_unit&sz=728x90&c=[TIMESTAMP]'/></a>[/newsletter-ad]
1. Use your specific Google Ad Manager Network Code: 61021078 - Used in this example, can be found under Admin > Global Settings > Network Code.
2. Update the URL to the specific AdUnit Code (This is specific to the actual Active Ad you want to use) in this example - test_ad_unit. This can be found under Inventory > Ad Unit - then select the Ad Unit you want to use:
3. Set the size to an actual size option from the AdUnit, in this example 728x90 is used.
From the example above you should be able to update any of your newsletters with the appropriate Ad Unit information and get the desired Ad from Google Ad Manager incorporated in the newsletter. Below is the example ad code that should be placed within the [newsletter-ad] shortcode:
<a href='https://pubads.g.doubleclick.net/gampad/jump?iu=/61021078/test_ad_unit&sz=728x90&c=[TIMESTAMP]' target='_blank'><img src='https://pubads.g.doubleclick.net/gampad/ad?iu=/61021078/test_ad_unit&sz=728x90&c=[TIMESTAMP]'/></a>
There is a way to disable (or enable) the click tracking links within a newsletter issue (known as a Campaign in MailChimp) through the MailChimp API. We implemented this through the use of a Rendering Option at the newsletter level (without the rendering option all newsletters will default to enable the click tracking).
To disable the click tracking for a campaign via the MailChimp API from within a newsletter you will need to use the Rendering Option mailchimp.enable.click.tracking and set the value to false
You will then need to go into the newsletter issue you plan to publish with the click tracking disabled, click ‘Generate creative content’ and when you want to send out the newsletter issue click ‘Release for publication’.
To confirm your click tracking has been disabled on a particular Campaign. If you ‘View Report’ on the particular campaign in MailChimp (for which you have setup the RO field to disable the click tracking) you will see the following:
Important Note: This disables click tracking for every link in the entire newsletter issue, so you may want to use it sparingly.