PPID parameter missing in ad requests with multiple <amp-ad> slots (works with only one)
Description
In an AMP page using
Expected Behavior:
The PPID, dynamically provided by the
Actual Behavior:
The PPID is included in the ad request only when a single
Reproduction Steps
- Set up an AMP page with
and to provide dynamic targeting, including PPID, using Permutive data stored in localStorage (see sample code below). - Add a single
component with type="doubleclick", configured with RTC to call the function permutiveCachedTargeting.ct, which returns {targeting: {...}, ppid: "..."}. - Validate the page with the AMP validator and load it in a browser.
- Inspect the ad request in the browser's DevTools (Network tab, filter for securepubads.g.doubleclick.net). Confirm that the PPID is included in the request (e.g., ppid=permutive-id-value).
- Add a second
slot with a similar RTC configuration. - Reload the page and inspect the ad request. The PPID parameter is missing from the request payload for all slots.
Sample code:
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
<script async custom-element="amp-script" src="https://cdn.ampproject.org/v0/amp-script-0.1.js"></script>
<script async custom-element="amp-state" src="https://cdn.ampproject.org/v0/amp-state-0.1.js"></script>
<link rel="canonical" href="...">
<meta name="viewport" content="width=device-width">
</head>
<body>
<!-- Permutive configuration -->
<amp-state id="permutiveConfig">
<script type="application/json">
{
"apiKey": "[MY_API_KEY]",
"projectId": "[MY_PROJECT_ID]",
"environment": "production"
}
</script>
</amp-state>
<amp-script id="permutiveCachedTargeting" sandboxed script="permutiveCachedTargetingScript"></amp-script>
<script id="permutiveCachedTargetingScript" type="text/plain" target="amp-script">
exportFunction('ct', () => {
let c = JSON.parse(localStorage.getItem('_pdfps'));
let i = localStorage.getItem('permutive-id');
return {targeting: {permutive: c ? c : [], puid: i}, ppid: i};
})
</script>
<!-- First ad slot (PPID included with single slot) -->
<amp-ad data-block-on-consent
data-slot="[...]/TopLeft"
width="..."
height="..."
data-multi-size="[MY_SIZES]"
data-multi-size-validation="false"
type="doubleclick"
rtc-config='{"urls": ["amp-script:permutiveCachedTargeting.ct"], "timeoutMillis": 1000, "vendors": {...}}'
json='{"targeting": {...}}'>
...
</amp-ad>
<!-- Second ad slot (PPID missing when added) -->
<amp-ad data-block-on-consent
data-slot="[...]/Frame1"
width="..."
height="..."
data-multi-size="[MY_SIZES]"
data-multi-size-validation="false"
type="doubleclick"
rtc-config='{"urls": ["amp-script:permutiveCachedTargeting.ct"], "timeoutMillis": 1000, "vendors": {...}}'
json='{"targeting": {...}}'>
...
</amp-ad>
</body>
</html>
Relevant Logs
Browser(s) Affected
No response
OS(s) Affected
No response
Device(s) Affected
No response
AMP Version Affected
2509191850000