# Inventory Placement

You can define as many placements as necessary for a configuration. Depending on the business model, some placements however, are reserved for Marfeel and cannot be overwritten.

# Placement key

Keys can contain up to five parameters, which must appear in the correct order and be separated by an underscore "_". The five parameters of keys are, in order:

graph LR
  A["Ad Type"] --> B["Navigation Level"] --> C["Section"] --> D["Virtual page"] --> E["Source"]
  1. Ad type:
    • inline
    • top
    • bottom
    • sticky
    • inter
  2. Navigation level:
    • mosaic - For section pages
    • details - For article pages
    • gallery - For gallery pages
  3. Section: Name of the section (which is specified in definition.json) that will be affected by this placement configuration.
  4. Virtual page: A number indicating the ad position that will be affected by this placement configuration. The virtual page is tightly coupled with the ad type.
  5. Source:
    • amp - To register a placement only for AMP pages.
    • web - For Touch-only placements. Particularly useful for ad servers that are not supported by AMP.
    • native - For Cherokee-only placements

TIP

Unless you specifically choose to exclude native ad placements, never add web to your placement key.

For example, the key for an inline ad that has to appear in the first position of AMP article pages from the "food" section should be: inline_details_food_1_amp.

Any time a parameter is not present, it is assumed that the placement is for all the values possible. For example, the key for all the inline ads in the "food" section would be: inline_food.

INFO

Out of page ads MUST use the inter placement.

# Placement Priority

An inventory can contain placements that are valid for multiple ad slots, such as:

{
  "inline_mosaic_portada": {...},
  "inline_mosaic_portada_2": {...},
  "inline_2": {...},
  "inline_mosaic": {...},
  "inline": {...}
}

This is not a problem and is even recommended: in addition to the placement-specific configuration, it is safer to always have one general placement, to guarantee ads in slots that were not planned.

You can know which placement applies to a specific slot by computing the weight of each placement, much like CSS selectors.

  • Ad type = 16
  • Source = 8
  • Section = 4
  • Navigation level = 2
  • Virtual page = 1

Unit test

Test any placements automatically by running the associated unit tests in Gutenberg, modifying the input and expected output: PlacementIdPriorityComparatorTest (opens new window).

# Virtual page depending on type

The virtual page count is reset for each ad type: bottom_1 will always be after inline_12

The bottom placement can have 3 virtual pages:

  • 1: Always appears above the comments
  • 2: Always appears below the comments
  • 3: Always appears right before the Marfeel logo

TIP

Sticky and inter don't have any virtual page since they are special placements. They can be differentiated by navigation level.

# Placement value

The placement object must at least define an ad server.

A minimum placement configuration would look like this:

{
    "inline_food": {
        "adServer": "doubleclick"
    }
}

If different ad servers have to be rendered in the same placement, it is possible to define a multiplayer placement. This feature must be used according to the Tenant's specific characteristics.

To configure it, use adServers instead of adServer and specify as many as required:

{
    "inline_food": {
        "adServers": ["doubleclick", "dfp", "tripleclick"]
    }
}

The ad server names must correspond with ad servers defined in the adserver object of the inventory.json.

# Placement additional configuration

In order to share ad server between several placements, define additional parameters that will be used by the adserver only for the current placement. Use the params attribute for this purpose. See ad server atrributes to know all the parameters.

Each key should be written in snake-case, all caps: this helps identify them as expecting to be replaced.

Example:





 
 
 




{
  "inline_food": {
    "adServer": "doubleclick",
    "params": {
      "SLOT_NAME": "/fake_slot",
      "WIDTH": "320",
      "HEIGHT": "50"
    }
  }
}