Guide #3: Create an Ad Unit in Ad Manager and Download Sample File

An ad unit is the final representation of the ads that will be displayed on your site. These units consist of four key elements:

  1. Top ad unit: Indicates whether this ad unit is standalone or part of an ad group.
  2. Name: A unique identifier to differentiate between ads and facilitate tracking in reports. Limited to 255 characters, it's recommended to avoid spaces, using underscores (_) or hyphens (-) instead.
  3. Dress: It's suggested that it be similar to the name for consistency. Spaces aren't allowed, but underscores or hyphens may be used.
    • Description: Optional, used for annotations about the announcement.
  4. Size: Select the « modeFixed size» and choose formats with the same orientation for better viewing. Avoid vertical sizes to optimize the user experience.

To create an ad unit:

  1. Go to the section «Inventory">"Ad units»And click«New Ad Unit«.
  2. Select whether it will be a top ad unit.
  3. Complete the name and code, following the recommendations mentioned.
  4. Choose the right size, favoring the recommended standard formats to increase the fill rate.
  5. Leave the other settings as default and click on «Save" at the end of the page.

 

Rewording the code to implement it

While you can use the default code provided by Google Ad Manager, implementing more than one code will result in unnecessary calls to the Google server, which will cause a delay in loading the site. Below, we will explain in a simple way how to reformulate the code provided by Google Ad Manager.

 

For example, let's use as an example a site called " worldtechnology " with the sizes "250x250, 300x250, 336x280".

For this purpose and for reasons of convention we recommend that you use the site name followed by an underscore (_) content and the order number (in this example it is the first one).

 

In this example the body code would look like this:

 

var Content1_slot;
googletag.cmd.push(function() {
var mapping = googletag.sizeMapping().addSize([0, 0], ['fluid',[250, 250],[300, 250],[336, 280]]).build();
Content1_slot = googletag.defineSlot(«/NETWORK_CODE/world technology/world technology_Content1″,[[250, 250],[300, 250],[336, 280]], «Content1»)
.defineSizeMapping(mapping)
.setCollapseEmptyDiv(true)
.addService(googletag.pubads());
googletag.enableServices();
});
    googletag.cmd.push(function() { googletag.display('Content1'); });
</div>

 

 

The file also includes the declared ads " Interstitial " (vignette) and " Anchor "

 

Recommended dimensions for interstitial advertising :

1×1,300×250, 320×480, 336×280

Recommended dimensions for Anchor ad :

320×50, 320×100, 728×90, 970×90, 980×90, 990×90

 

Once the ad units have been created within admanager We need to extract the tags so we can implement them on the website.

 

Below is an ad block generator we created to replace your data and generate the document with the ad tags inside. If you don't want to use it, I'll also provide the template file for you to download and modify yourself.

Ad Block Generator

ads.txt file

 

 

Share

Related Posts

Subscribe to our newsletter and receive the latest news, exclusive offers, and content specially curated for you.

Enter your email now