ampproject / ampproject/amphtml
Consent parameters not sent in ads requests using GPT
- Dominant language
- JavaScript
- Stars
- 14.9k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to develop a amp-ad type network, to implement some ad related custom features.
To request the ads and inspect what has been served, I'm using GPT, as usual:
```
window.googletag.cmd.push(function() {
const slot = window.googletag
.defineSlot('NETWORK/SLOT/PATH', [300,250], 'div-container-id')
.addService(pubads);
window.googletag.enableServices();
window.googletag.display('div-container-id');
});
```
Ads are correctly loaded and displayed, so everything seems normal.
However, when inspecting the network requests in the dev console, the consent parameters (gdpr, gdpr_consent, etc.) are not passed in the ads request (as they do in non amp requests), though I confirmed they are present in the component window.context:

Shouldn't these parameters be automatically handled and added by the GPT library?
If so, is there something else I need to configure or implement?
If not, how should I instruct GPT to add them to the request?
Thanks in advance!
Contributor guide
Assessment
This issue has not been assessed yet.