Render Ads
After Install, call _raasCsa("ads", pageOptions, adBlock1, …) from an inline script. The _raasCsa stub in <head> queues the call until the bundle is ready.
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Ads units</title>
<script type="text/javascript" charset="utf-8">
(function (g, o) {
g[o] =
g[o] ||
function () {
(g[o].q = g[o].q || []).push(arguments);
};
g[o].t = Date.now();
})(window, "_raasCsa");
</script>
<script
async
src="https://cdn.ace1m.com/raas/v1/raas.global.js"
data-tenant-id="YOUR_ACE1M_TENANT_ID"
data-tenant-key="YOUR_ACE1M_TENANT_KEY"
data-allocated-channels='["ch1","ch2","ch3","ch4","ch5"]'
data-verbose="false"
></script>
</head>
<body>
<p>Page content</p>
<div id="afscontainer1"></div>
<p>Search result 1</p>
<p>Search result 2</p>
<p>Search result 3</p>
<div id="afscontainer2"></div>
<script type="text/javascript" charset="utf-8">
var pageOptions = {
pubId: "your-client-id",
query: "some search",
styleId: "1234567890",
// IMPORTANT: do NOT reuse your RaaS `allocatedChannels` values in `channel`.
channel: "clientChannel",
adsafe: "high",
adPage: 1,
};
var adBlock1 = {
container: "afscontainer1",
width: 700,
// If this unit is above the results, add maxTop per Google CSA rules.
};
var adBlock2 = {
container: "afscontainer2",
width: 700,
};
_raasCsa("ads", pageOptions, adBlock1, adBlock2);
</script>
</body>
</html>
Key pageOptions fields (ads)
| Field | Required | Why it matters |
|---|---|---|
pubId | Yes | CSA client id. |
query | Yes | Search query for the ads request. |
styleId | No | Custom style id (falls back to a system default if omitted). |
channel | No | AdSense channel id(s). IMPORTANT: do NOT include any of your RaaS allocatedChannels values in this field. |
adsafe | No | Ad filtering: high (default), medium, or low. |
adPage | No | Results “page index” for paginated SERP ads. |
acb | No | no-args callback. |
For the full list of page-level fields, see the Google CSA reference.
Key block fields (ads)
| Field | Required | Why it matters |
|---|---|---|
container | Yes | Id of the empty container element for the ad unit. |
width | Yes | Unit width (e.g. 700 or "700px"). |
maxTop | No | Only when the unit is above the results; see Google CSA rules. |
adLoadedCallback | No | Optional CSA callback when the unit finishes loading (or has nothing to show). |
For all other fields and edge-case behavior, use the Google CSA reference.