ampproject / ampproject/amphtml

Consent parameters not sent in ads requests using GPT

Open
#32,035 12 comments 0 reactions 1 assignee Claimed by @calebcordry View on GitHub
Stale Type: Bug Type: Discussion/Question WG: monetization
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:

![context](https://user-images.githubusercontent.com/34578048/105018876-680b2d80-5a3d-11eb-97e9-c29c1df25488.png)

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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.