Search Images Maps Play YouTube News Gmail Drive More »
Sign in

Tagging instructions

Configure Google Ad Manager (GAM) tags

This article describes how to configure Google Ad Manager (GAM) tags. To take advantage of the latest features of DFP Small Business, upgrade your tags to Google Publisher tags (GPT).

Preparing a page to serve ads with DFP Small Business requires distinct blocks of JavaScript, described below. Do not combine JavaScript blocks, or your code may break.

Step HTML Description
  <html>
<head>

 
Step 1 <script language="JavaScript" src="http://partner.googleadservices.com/gampad/google_service.js">
</script>

Required: Load JavaScript files used by DFP Small Business.
Step 2 <script language="JavaScript" type="text/javascript">
    GS_googleAddAdSenseService("ca-pub1");
    GS_googleEnableAllServices();
</script>

Required: Enable your page to display ads.
Step 3 <script language="JavaScript">
    GA_googleAddAttr("Gender", "Male");
    GA_googleAddAttr("AgeRange", "18To24");
    GA_googleAddAttr("InterestArea", "cars");
</script>

Optional: Set page-level attributes that influence ad selection. Arguments are case-sensitive (example: 'male' isn't the same as 'Male').
Step 4 <script language="JavaScript">
    GA_googleAddSlot("ca-pub1", "GizmosUnlimited_HelpCenter_FAQs_ATF_Left_90x90");
    GA_googleAddAdSensePageAttr("google_color_bg", "F0F0F0");
    GA_googleAddAdSenseSlotAttr("AdUnitName", "google_color_bg", "F0F0F0");
</script>
  • (Required) GA_googleAddSlot: Define the ad units on your page. This example uses a fictitious ad unit name ("GizmosUnlimited...") described in Choosing a Naming Convention.
  • (Optional) GA_googleAddAdSensePageAttr: For pages that serve AdSense ads, you may pass AdSense parameters to all ad units that appear on a page.
  • (Optional) GA_googleAddAdSenseSlotAttr: For Adunits that serve AdSense ads, you may pass AdSense parameters and values to a particular unit.
Step 5 <script language="JavaScript">
    GA_googleFetchAds();
</script>

Required: Retrieve the ads for your page.
 

</head>

<body>
<h1>Title of your Page</h1>

 
Step 6 <script language="JavaScript">
        GA_googleFillSlot("GizmosUnlimited_HelpCenter_FAQs_ATF_Left_90x90");
 </script>

Required (once per ad unit): Display Ads
 

<p>Normal content of your Web page.</p>

</body>
</html>

 

Learn how to generate ad unit tags.