Skip to content

Creating Newsletter Components

To create a request to our newsletter API use the code example below as a template:

shell
# endpoint example with placeholders
https://io.admeira.ch/v1/loadslot?publisher=<your-domain>&language=<your-language>&platform=Mail&channel=Newsletter&format=<our-slot-code>&mime=<our-mime-type>&c=<your-cache-buster><your-optional-targeting>

Note: Each time the endpoint is invoked, an impression is measured by the ad server!

Please make sure, that you display the ads to subscribers properly.

Please replace the placeholders from the endpoint example above using your proper values.

PlaceholderExampleDescription
<your-domain>example.comdomain name of your site
<your-language>DElanguage of the site, e.g. DE/FR/IT/EN
<your-cache-buster>1575627491cache-buster to prevent the request from being cached, e.g. a unix timestamp
<your-optional-targeting>t=key1%3Dvalue1%26key2%3Dvalue2additional url-encoded targetings are appended to our t= parameter
<our-slot-code>MR_1Slotcode with position indication, e.g. MR_1, MR_2, MR_3-TE
<our-mime-type>mail/image-urlsee below...

Our newsletter API supports three types of requests, which can be set via our mime parameter

mimeresponse
mail/image-urlreceives a banner image
mail/click-urlredirects to landing page
mail/jsonJSON object with all banner information

Image Banner example

The following example can be used for loading of image banners in email clients.

html
<!-- Image banner example -->
<a href="https://io.admeira.ch/v1/loadslot?publisher=Testsite&language=DE&platform=Mail&channel=Newsletter&format=MR_1E&mime=mail/click-url&c=1231236">
    <img src="https://io.admeira.ch/v1/loadslot?publisher=Testsite&language=DE&platform=Mail&channel=Newsletter&format=MR_1E&mime=mail/image-url&c=1231237" alt="Advertisement">
</a>

JSON response example using jQuery

The following example can be used to load newsletter assets like image, click url, etc. from the ad server.

javascript
$(function(){
    var url = 'https://io.admeira.ch/v1/loadslot?publisher=Testsite&language=DE&platform=Mail&channel=Newsletter&format=MR_1&mime=mail/json&c=1231238&t=keywords%3Dguru';
    $.get(url, (response) => {
      console.log(response);
    });
  });

Note: The JSON response is different for an image banner and a native banner. When receiving information for a native banner, creativeWidth and creativeHeight are set to 1.

Image banner response as a JSON

JSON
{
  "imageUrl": "https://tpc.googlesyndication.com/pagead/imgad?id=CICAgKCnnPq8DhABGAEyCF7cGQ2HS7J2",
  "title": "",
  "bodyText": "",
  "callToAction": "",
  "creativeWidth": "300",
  "creativeHeight": "250",
  "clickUrl": "https://adclick.g.doubleclick.net/pcs/click?xai=AKAOjstP_UeZGyLy9vSnthkZrQjU0VTCDAjcCiQTgK3JbRU4YDiA5KGbDRqLweFrxg5J5Wo0WMCF16aaBziGtTUI_4rXLM4VH0xVA3w35LInK9-hierW4HPDVzdwZIHUnfCwcZ0SOzCvtE2moeOI_7S8g2j5O6Afj8uhArM7tqXRTe1-Ygy6rwHpZlHkdBH6kHWLdMfuIFVYP8_3qrxtRnIzagCBTVdUEdEaQIqTauh5qFV9w6A&sig=Cg0ArKJSzFRbDkMXqPYYEAE&urlfix=1&adurl=https://www.ringier.ch"
}

Native ad response as a JSON

JSON
{
  "imageUrl": "https://tpc.googlesyndication.com/pagead/imgad?id=CICAgKCnnPq8DhABGAEyCF7cGQ2HS7J2",
  "title": "Ringier Advertising Newsletter Ad",
  "bodyText": "Discover the future - a new dimension of advertising has arrived!",
  "callToAction": "Learn more",
  "creativeWidth": "1",
  "creativeHeight": "1",
  "clickUrl": "https://adclick.g.doubleclick.net/pcs/click?xai=AKAOjstICSc9QX4zXOlHU1rKzsXeYOheRIR4h8wArLi6H8d7j88wKhZoUyO0qeM_UNpcNR0fLN__CPdQRfHcF1Lb7NhD3xU-uNi13BjjZzAFGtYYsLNhfQRDIloSj_9Oj-xxAjiL4o2-oExiY6IhHL4dt3H_fg89tVRA5soFjReWrG7dRD4BBDzZoS2htJFDzZiDJLkHGT-CMOLNwbv9beo_VfmDARHEfawShzupevxgNJuIrkA&sig=Cg0ArKJSzK21cDgaAjTvEAE&urlfix=1&adurl=https://www.ringier.ch"
}