Ads Integration

There are two ways to request ads on the A2 platform: directly calling the Decision API or using the Web SDK. Directly calling the Decision API has the advantage of being able to directly control most aspects of the ad request, but it is relatively more complex because you need to develop both the process of requesting and displaying ads, as well as integrating logs.

Preparation

Before requesting ads via API, ad placement must be completed. Please refer to the guide below.RetryClaude can make mistakes. Please double-check responses.

Ad Request

The tagid required when calling the Ad Serving API is the id in the Placement Information section on the detail page of Ads > Placements > Placement List > (Click on placement).

If you are currently using A2 service, you can directly test the actual service API using the Developer Portal.

Displaying Ad

When the ad serving API responds normally, you can obtain results like the following.

Response Example
{
  "ad": {
    "display": {
      "banner": {
        "img": "https://example.com/image.jpg"
      },
      "h": 1024,
      "w": 768
    },
    "id": "b56dc3bf-935d-4ee6-b1ed-f31bfc02be91"
  },
  "ext": {
    "ad_log": "YTU2ZDY2ZjctNDM4ZS00OTVjLWJiYTAtMjI4Mzk2MjQ0ZWVkfDA2NDI4NjYwLWY2NDMtNGVmNS05MzgzLTZjZmE1OGYxOGI2OXxjNTZkYzNiZi05MzVkLTRlZTYtYjFlZC1mMzFiZmMwMmJlOTF8NGJlMmQ4ZTYtYThhMS00NzI2LWEzMjAtNjkyNTYzMDkwZTQyfDllZjY2ZGM4LTBlMmMtNDlmMS05NDU3LWFmYmUwZGQ2ZjU3M3w1NTgxNmIzOTcxMWY5YjVhY2YzYjkwZTMxM2VkMjllNTE2NjU2MjNm",
    "message": "success"
  },
  "version": "0.1.0"
}

You must proceed with appropriate impression processing using the received ad data.

When using the web SDK, materials are actually displayed according to the placement settings, but when using the API, you must directly implement the business logic needed for impressions. It is strongly recommended that the work required for impressions be done on the server side rather than on the service app or web side.

If you need additional support, you can contact the A2 support team through the following channels: