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

Remove Engadget workaround from google-ima shim #36

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

kzar
Copy link
Contributor

@kzar kzar commented Nov 28, 2023

There was a workaround in the google-ima shim that applied only to
www.engadget.com that set a current advert to be returned by
AdEvent.getAd() and AdsManager.getCurrentAd(). When testing the
website, I couldn't see that code-path being hit at all, so let's
remove the workaround. Also, let's take care to return null instead of
undefined as is specified[1].

In the future, we could expand this logic if necessary. I think
setting the currentAd to new Ad() when the AdEvent.Type.LOADED event
fires and back to null when AdEvent.Type.ALL_ADS_COMPLETED fires would
make sense - but we would need to test that doesn't cause more website
breakage first.

1 - https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdEvent#getAd

Copy link
Collaborator

@dharb dharb left a comment

Choose a reason for hiding this comment

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

👍

There was a workaround in the google-ima shim that applied only to
www.engadget.com that set a current advert to be returned by
AdEvent.getAd() and AdsManager.getCurrentAd(). When testing the
website, I couldn't see that code-path being hit at all, so let's
remove the workaround. Also, let's take care to return null instead of
undefined as is specified[1].

In the future, we could expand this logic if necessary. I think
setting the currentAd to new Ad() when the AdEvent.Type.LOADED event
fires and back to null when AdEvent.Type.ALL_ADS_COMPLETED fires would
make sense - but we would need to test that doesn't cause more website
breakage first.

1 - https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdEvent#getAd
@kzar kzar marked this pull request as ready for review November 30, 2023 13:00
@kzar kzar merged commit acf80a1 into duckduckgo:main Nov 30, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants