# Use an Ad Server Provider

This article helps you decide if you should use Ad server Providers or legacy ad servers. It describes the workflows to follow with ad server providers The workflows described in this article are subject to change as the rollout progresses. Ask ALOT if you have any doubt!

# Working with XPlib Media Groups

Follow the flow!

If you need to...

graph LR
    id4["Reuse a legacy core adserver without changes"] --> id5[Use the legacy Core ad server]
    id8["Reuse a legacy custom adserver"] --> id9["Delete the legacy custom ad server"]
    id8 --> id2["Create an ad server provider"]
    id1["Create a new core ad server"] --> id2
    id11["Create a new custom ad server"] --> id2
    id3["Reuse an existing  ad server provider"] --> id2
    id6["Reuse a legacy core adserver ~with~ changes"] --> id2
    id6 -.-> |If the ad server is only used by xpLib tenants| id10["Delete legacy core ad server"]

# Use an ad server providers in XPlib tenants

Once you have an existing ad server provider, you can use it in an XPlib tenant following these steps:

  1. Search the last version of the ad server in the Marfeel releases repository (opens new window) (e.g. MGID (opens new window)).

  2. Install the ad server as a package dependency by executing the following command at the Media Group root directory:

npm install @marfeel/adserver-providers-mgid@1.2.11 --save
  1. Check the ad server schema to see which options can be configured from inventory.json. It can be found in the schema folder of the ad server package and in its source repository (e.g. MGID JSON schema (opens new window)).

  2. Configure the ad server in inventory.json using the properties found in its schema:

{
  "placements": {
    "inline": "mgid"
  },
  "adServers": {
    "mgid": {
      "type": "mgid",
      "publisher": "news365.co.za",
      "widget": "178159",
      "container": "M285129ScriptRootC178159"
    }
  }
}

# Working with legacy Media Groups

Follow the flow!

If you need to...

graph LR
    id3["Create a new custom ad server"] -.-> id4["Migrate tenant to XPLib and see previous chart"]
    id3 -.-> |OR, if XPLib is impossible| id12["Use the legacy custom adserver implementation"]
    id1["Create a new core ad server"] --> id4
    id5["Use an ad server provider"] --> id4
    id10["Reuse a legacy core adserver ~with~ changes"] --> id4
    id11["Reuse a legacy custom adserver"] --> id12
    id8["Reuse a legacy core adserver without changes"] --> id9[Use the legacy Core ad server]