Advertisement display in WebView in the application

Ad tags processed with JavaScript function also in the WebView of the smartphone application and display advertisements, just as when browsing the website with the browser. However, advertisements viewed with browsers and ads viewed in the WebView of the application have different settings to enable RTB (real-time bidding).

This document introduces how to introduce ad tags in applications using WebView.

Tag Setting

On the page to be read by WebView, set the tag registered with the management tool. And advertisements will be displayed at the place it set up when launching the application.

However, advertisements are displayed, but in this state RTB is not done.

<html>
  <head>
    <title>Page loaded in WebView</title>
  </head>
  <body>
    <script type="text/javascript" src="Issued ad tag.js"></script>
  </body>
</html>
1
2
3
4
5
6
7
8

Setting of RTB parameters

Parameters used for RTB of in-app advertisement are as follows.

パラメータ名 内容
idfa "Identification For Advertisers" on iOS, "Advertising ID" on Android
lat Limit Ad Tracking
bundle "Bundle Id" on iOS, "Package Name" on Android
carrier(MCC+MNC) A string such as "44020" as an example. It is not used on terminals without SIM

If it set the above parameter to the global variable geparams, the ad tag will use it for RTB. (** Please note that parameter setting must be done before ad tag is called.) **)

<html>
  <head>
    <title>Page loaded in WebView</title>
  </head>
  <body>

    <script>
      var geparams = {};
      
      // Set the value obtained from the application
      geparams.idfa = 'xxx';
      geparams.lat =  false;
      geparams.bundle = 'xxx';
      geparams.carrier = 'xxx';
    </script>

    <script type="text/javascript" src="Issued ad tag.js"></script>
  </body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

About detailed implementation

Parameters used for RTB must be obtained by native processing of the application. And it must work together so that it can be used with JavaScript inside WebView. This implementation is platform dependent.

Please refer to the following pages for details on each platform.

Last Updated: 9/28/2020, 1:56:32 PM