Displaying Ads on the placement via Web SDK
This guide introduces methods for requesting ads and advertising log integration.
Ads Integration
There are two ways to request ads on the A2 platform: by calling the Decision API directly and by using the web SDK. Using the Decision API directly has the advantage of giving you direct control over most aspects of the ad request, but it’s a bit more complicated because you’ll need to develop both the process of requesting and serving ads and integrating logs. We provide a web SDK to make it easy and convenient to apply these pieces.
Ads Request
By Web SDK
The Web SDK is a package that can be embedded into web page that contains a placement. It is configured to allow you to request ads with easy setup. To use the Web SDK, you need to embed the SDK in a web page.
The insertion of the SDK is done by following these steps:
- Log in to ADM and navigate to the Placement menu.
- Select the desired placement from the Placement List and click on Get Placement Tag.
- Copy the footer tag provided on the page (see screenshot below) and paste it at the bottom of your web app’s HTML source.
- Insert the provided
<div id="a2plct1"></div>
code where you want the ad to appear. You can modify thea2plct1
part as needed.
Once set up, the ad will be automatically integrated.
By Server APIs
You can use API to get ads. To learn more about the serving an ad through apis, check this Ads integration with API.
Ads Log Integration
By Web SDK
Log integration is automatic with the web SDK. The conditions for each log transmission are as follows:
- Ad Request Log: The ad request log is recorded when the ad is ready to be displayed to the user, meaning the likelihood of the ad appearing on the screen has increased. Specifically, this log is sent when the user’s view approaches within about four times the height of the ad, just before the ad appears on the screen.
- Impression Log (vimp): The impression log is recorded when the ad actually appears on the user’s screen and becomes visible. More specifically, it’s logged when at least 50% of the ad is visible on the screen for over one second. Compared to the ad request log, which logs when the ad is likely to appear, the impression log records when the ad is actually visible on the screen.
- Click Log: The click log is sent when the ad is clicked by the user. This captures the exact moment when the user interacts with the ad, allowing for the analysis of ad engagement performance.
With this type of log integration, you can gain a more accurate understanding of ad performance and make improvements to enhance ad efficiency effectively.