Skip to main content

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)​

FieldRequiredWhy it matters
pubIdYesCSA client id.
queryYesSearch query for the ads request.
styleIdNoCustom style id (falls back to a system default if omitted).
channelNoAdSense channel id(s). IMPORTANT: do NOT include any of your RaaS allocatedChannels values in this field.
adsafeNoAd filtering: high (default), medium, or low.
adPageNoResults “page index” for paginated SERP ads.
acbNono-args callback.

For the full list of page-level fields, see the Google CSA reference.

Key block fields (ads)​

FieldRequiredWhy it matters
containerYesId of the empty container element for the ad unit.
widthYesUnit width (e.g. 700 or "700px").
maxTopNoOnly when the unit is above the results; see Google CSA rules.
adLoadedCallbackNoOptional 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.