Appearance
AMP Integration
Overview
Missena supports integration with AMP (Accelerated Mobile Pages) through Prebid Server and AMP's Real-Time Config (RTC) mechanism.
Since AMP restricts custom JavaScript, traditional client-side header bidding is not possible. Instead, the auction happens server-side via Prebid Server (prebid.missena.io), and targeting keys are passed to your ad server (e.g. Google Ad Manager) automatically.
How it works
- AMP loads the
<amp-ad>component - AMP calls Prebid Server's
/openrtb2/ampendpoint via thertc-configattribute - Prebid Server resolves the stored request for your
tag_id, runs the auction with Missena - Prebid Server returns targeting keys (
hb_pb,hb_bidder,hb_cache_id, etc.) - AMP applies the targeting to the ad server request
- GAM line items match on targeting and serve the Prebid creative if it wins
Tag ID Format
The tag_id used in the RTC URL identifies your stored request on Prebid Server. It follows this format:
PA-XXXXXXXX-{placement}-{sample}| Part | Description | Examples |
|---|---|---|
PA-XXXXXXXX | Your Missena API key | PA-34745704 |
{placement} | Ad placement type | footer, infeed |
{sample} | Creative sample type | native, banner |
For example: PA-34745704-footer-native or PA-34745704-infeed-banner.
The sample part is optional — you can also use PA-XXXXXXXX-{placement} only (e.g. PA-34745704-footer).
Contact Missena support to get your tag ID configured on Prebid Server.
Prerequisites
Before starting, make sure you have:
- Your Missena tag ID (e.g.
PA-34745704-footer-native) - A Google Ad Manager (GAM) ad unit configured with Prebid line items
- A stored request configured on Prebid Server for your tag ID — contact Missena support to set this up
Integration Steps
1. Include AMP Scripts
Add the required AMP ad script in your <head>:
html
<script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>2. Add the Ad Tag
Place the <amp-ad> tag in your page with the rtc-config attribute pointing to Missena's Prebid Server:
html
<amp-ad
width="300"
height="250"
type="doubleclick"
data-slot="/YOUR-NETWORK-ID/YOUR-AD-UNIT"
rtc-config='{
"urls": [
"https://prebid.missena.io/openrtb2/amp?tag_id=PA-XXXXXXXX-footer-native&w=ATTR(width)&h=ATTR(height)&ow=ATTR(data-override-width)&oh=ATTR(data-override-height)&ms=ATTR(data-multi-size)&slot=ATTR(data-slot)&targeting=TGT&curl=CANONICAL_URL&timeout=TIMEOUT&adc=ADCID&purl=HREF&gdpr_consent=CONSENT_STRING&consent_type=CONSENT_METADATA(consentStringType)&gdpr_applies=CONSENT_METADATA(gdprApplies)"
],
"timeoutMillis": 1000
}'>
</amp-ad>Note
Replace PA-XXXXXXXX-footer-native with your Missena tag ID (see Tag ID Format above) and /YOUR-NETWORK-ID/YOUR-AD-UNIT with your GAM ad unit path.
3. Using with infeed
To display Missena as an in-feed ad within your content, place the <amp-ad> tag where you want the ad to appear and use an infeed tag ID:
html
<amp-ad
width="300"
height="250"
type="doubleclick"
data-slot="/YOUR-NETWORK-ID/YOUR-AD-UNIT"
rtc-config='{
"urls": [
"https://prebid.missena.io/openrtb2/amp?tag_id=PA-XXXXXXXX-infeed&w=ATTR(width)&h=ATTR(height)&ow=ATTR(data-override-width)&oh=ATTR(data-override-height)&ms=ATTR(data-multi-size)&slot=ATTR(data-slot)&targeting=TGT&curl=CANONICAL_URL&timeout=TIMEOUT&adc=ADCID&purl=HREF&gdpr_consent=CONSENT_STRING&consent_type=CONSENT_METADATA(consentStringType)&gdpr_applies=CONSENT_METADATA(gdprApplies)"
],
"timeoutMillis": 1000
}'>
</amp-ad>RTC Parameters Reference
The rtc-config URL uses AMP macros that are automatically resolved at runtime:
| Macro | Description |
|---|---|
ATTR(width) / ATTR(height) | Ad slot dimensions |
ATTR(data-override-width) / ATTR(data-override-height) | Override dimensions if set |
ATTR(data-multi-size) | Multi-size ad request |
ATTR(data-slot) | GAM ad unit path |
TGT | Existing targeting key-values |
CANONICAL_URL | Page canonical URL |
TIMEOUT | RTC timeout value |
ADCID | AMP Client ID |
HREF | Current page URL |
CONSENT_STRING | User's consent string (TCF) |
CONSENT_METADATA(consentStringType) | Consent string type |
CONSENT_METADATA(gdprApplies) | Whether GDPR applies |
Full Page Example
html
<!doctype html>
<html amp lang="en">
<head>
<meta charset="utf-8">
<title>My AMP Page</title>
<link rel="canonical" href="https://example.com/my-page" />
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<!-- AMP scripts -->
<script async custom-element="amp-ad"
src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
<!-- AMP boilerplate -->
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style>
<noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;animation:none}</style></noscript>
<script async src="https://cdn.ampproject.org/v0.js"></script>
</head>
<body>
<h1>My Article</h1>
<p>Article content goes here...</p>
<!-- Missena ad via Prebid Server -->
<amp-ad
width="300"
height="250"
type="doubleclick"
data-slot="/YOUR-NETWORK-ID/YOUR-AD-UNIT"
rtc-config='{
"urls": [
"https://prebid.missena.io/openrtb2/amp?tag_id=PA-XXXXXXXX-footer-native&w=ATTR(width)&h=ATTR(height)&ow=ATTR(data-override-width)&oh=ATTR(data-override-height)&ms=ATTR(data-multi-size)&slot=ATTR(data-slot)&targeting=TGT&curl=CANONICAL_URL&timeout=TIMEOUT&adc=ADCID&purl=HREF&gdpr_consent=CONSENT_STRING&consent_type=CONSENT_METADATA(consentStringType)&gdpr_applies=CONSENT_METADATA(gdprApplies)"
],
"timeoutMillis": 1000
}'>
</amp-ad>
</body>
</html>Testing
You can test the Prebid Server endpoint directly using curl:
bash
curl 'https://prebid.missena.io/openrtb2/amp?tag_id=PA-XXXXXXXX-footer-native&w=300&h=250'Verify that the response includes targeting keys like hb_pb, hb_bidder, and hb_cache_id.
Support
For help setting up your stored request on Prebid Server or configuring GAM line items, contact your Missena account manager.