Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Google Ad Manager Publisher first-party IDs #40249

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

glevitzky
Copy link
Contributor

Addresses #40248.

Implements both cookie writing and reading components described in the linked I2I. In particular, we will set the specified cookies on the ad response HTTP header, and add those cookies to ad requests when available. We also add here some ads utility functions for verifying user consent for cookies, and some global cookie utility functions for checking whether setting cookies is allowed.

This change on its own is mostly a no-op, as serving is not yet setup to send to the new HTTP cookie header.

@erwinmombay erwinmombay requested review from ychsieh and removed request for powerivq March 7, 2025 19:36
@erwinmombay
Copy link
Member

@ychsieh could you help me review this while @powerivq is out

@erwinmombay
Copy link
Member

@glevitzky do you know if the failing unit tests are related to this change?

1) should stay in modal if focus stays in modal and close if outside
     amp-lightbox component  
     AssertionError: expected close to have been called exactly once, but it was called 0 times
    at http://localhost:9876/home/circleci/project/extensions/amp-lightbox/0.1/test/test-amp-lightbox.js:250:29

2) uses custom CSS when element is focused
     amp-social-share  

* iframe. Exposed as own function to ease unit testing. (It's near
* impossible to simulate the postmessage coming from the creative iframe in
* unit test environments).
* @param {Event} event
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably be {!Event}

* @param {!Window} win
* @return {boolean}
*/
export function canSetCookie(win) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non blocking, but can this value be memoized in some fashion?
would be happy with a comment/note if yes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure it's a tiny edge case, but strictly speaking, a user can disable cookies on their browser at any time, invalidating our previously memoized value.

@glevitzky
Copy link
Contributor Author

Test failures look unrelated. Running amp unit --verbose --files="extensions/amp-lightbox/0.1/test/test-amp-lightbox.js" from a clean branch results in the same failure.

@powerivq
Copy link
Contributor

Do we want to do a design review for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants