Skip to main content
This optional exercise displays the banner created in Ad Serving Quickstart on a web page. Enter your A2 server URL and AdUnit ID in the HTML template, load the ad, send a click, then verify metrics in Ad Manager.

1. Prepare the example template

Use the same environment and AdUnit ID that returned an HTTP 200 ad response in the Quickstart. Prepare a web browser and Python 3. Ad requests and click delivery do not require an access token. Create a folder for the example file.
Copy the complete HTML below and save it as plain text at ~/a2-banner-example/banner-ad.html using your text editor.
banner-ad.html
Run the following from the ~/a2-banner-example folder containing the file. Port 9000 avoids a conflict with the A2 server.
Open http://localhost:9000/banner-ad.html.

2. Request and display the ad

Fill in the template’s fields and select Load ad once. You do not need to edit the HTML source. Confirm Ad request: HTTP 200, Rendering: complete, and the A2 banner. Expand Response JSON to inspect the complete response for this request. This page requests a new ad. It stores the ext.ad_log from the ad response displayed on the page and sends it automatically when the banner is clicked. For HTTP 204, follow the Ad Serving Quickstart checklist.
This example uses the On Ad Response impression tracking configured in the Quickstart. Receiving a banner response records one more impression. Do not send an additional imp event.

3. Send the click event

Click the displayed banner once. Confirm that example.com opens in a new tab and the exercise page shows Click delivery: HTTP 200 — check metrics.
Web example showing the server URL, AdUnit ID, HTTP 200 response, and rendered banner

The shared template after entering the server URL and AdUnit ID and verifying banner rendering and click delivery.

The example’s click handler sends this body to POST /dmp/v0/log with that ad’s ad_log. The page has already sent it; do not send it again from the terminal.
Body sent on click
See Ad Event Tracking for sending clicks from your service. HTTP 200 does not guarantee collection or aggregation, so continue through the metrics check.

4. Verify recorded impressions and clicks

1

Open AdUnit Analytics

In Ad Manager, go to Analytics > Inventory Analytics > AdUnit Analytics.
2

Select the exercise AdUnit and period

Search using the copied AdUnit ID to find Quickstart banner. Include the exercise date in the query period. Align dates to Asia/Seoul when comparing with the console.
3

Compare with expected counts

Compare impressions and clicks with the table below. Aggregation can be delayed, so reload the page later. Do not request another ad or resend clicks merely to check metrics.
Date range and impression and click counts in the AdUnit Analytics detail view

The Basic Analysis view of an ad unit in AdUnit Analytics. Check the date range and impression and click counts. Values shown are examples.

If the new AdUnit received only this exercise’s requests, expect the following counts. If you made extra requests or reloaded the page and loaded another ad, add each successful banner response to the expected impression count. If other traffic reached the AdUnit, compare all request records for the same AdUnit and period.

Completion criteria

  • The banner response contains an image, landing URL, and ext.ad_log.
  • The page displays the banner, and clicking opens the landing page.
  • You have checked the click request and HTTP response.
  • You have verified actual impression and click aggregates in AdUnit Analytics.
Aggregation timing can vary with the A2 environment’s configuration. After the interval provided by your deployment contact has passed, reload the analytics page. If you do not know the expected interval, ask your contact; do not repeat ad requests or clicks just to check metrics. If the expected aggregates still do not appear after querying the same AdUnit, date, and timezone again, the exercise is incomplete. Prepare request times and timezone, AdUnit ID, responses, click delivery records, and query scope, then follow the support procedure in Verification and Troubleshooting. Individual event collection status cannot currently be queried.

Troubleshooting

Check the server URL, then inspect HTTPS, CORS, and preflight errors in the browser’s Network and Console tabs. The API must allow requests from http://localhost:9000; duplicate Access-Control-Allow-Origin headers cause the browser to block the response.
Check image URL accessibility and blocked image requests. An impression may already be recorded when the ad response is generated.
Check click delivery results, the query period, and AdUnit ID. Network errors or timeouts do not prove processing failure; do not retry unconditionally.
Check repeated requests, loading another ad after a reload, multiple clicks, or other traffic.

Next steps

See Ad Event Tracking to record impressions, clicks, and conversions in your service.