-
Notifications
You must be signed in to change notification settings - Fork 31
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
Share AdTargeting between Islands #8095
Conversation
Size Change: +615 B (0%) Total Size: 589 kB
ℹ️ View Unchanged
|
47c86d4
to
e0b5520
Compare
26309b2
to
cf02622
Compare
e0b5520
to
5769830
Compare
@@ -72,7 +72,6 @@ const Renderer = ({ | |||
format, | |||
|
|||
element, | |||
adTargeting: undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure why this was undefined
… we may need to review if this change has an impact after merging.
5769830
to
f2538d7
Compare
## What are you changing? - The `YoutubeAtomPlayer` can only be initialised once, and we require the ad targeting to be present before initialisation. ## Why? - Ad targetting is set asyncronously client-side in guardian/dotcom-rendering#8095, so we need to handle the value being `undefined` for the first render. - The current interface wasn’t srict enough so thanks @arelra for spotting this as the compiler would not have complained!
this removes an `any` and creates an explicit relationship between parsing and consumption
This ensures alignment for all code that checks for server or client. No longer checks against `document`, only `window`
this enables asynchronous ad targeting
This simplifies the logic of handling ad targetting across all Islands by setting it once via SWR.
f2538d7
to
d36891e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Just to point out that atoms-rendering
is bumped here to bring in: guardian/csnx#675
## What are you changing? Pass valid ad targeting to `YoutubeAtom` stories so the player is able to load. ## Background Since guardian/dotcom-rendering#8095 ad targeting will be set async on the client so it could be undefined initially and then defined in subsequent render passes. However the player requires ad targeting before it initialises and makes the request to YouTube so we block the player until ad targeting is defined as implemented in #675.
What does this change?
This simplifies the logic of handling ad targetting across all Islands by setting it once via SWR like we did for AB Tests in #4200.
An optional override for media duration (
videoLength
) is provided.Why?
Required to avoid having to drill the property deeply into Front Cards in #8075
Screenshots