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

fix: persistent page-level targeting values #129

Merged
merged 2 commits into from
May 17, 2023

Conversation

caffeinated-pixels
Copy link
Contributor

Description

This PR fixes an issue where old page-level targeting values are not getting removed from googletag.pubads() when the ad config that gets passed into AdvertisingProvider updates. What this mean is that when targeting values are removed from your ad config, they still persist in googletag.pubads().

The fix is to call pubads.clearTargeting() to clear all previous targeting values before calling pubads.setTargeting(key, value) to pass in the updated targeting values.

Copy link
Contributor

@jdw1996 jdw1996 left a comment

Choose a reason for hiding this comment

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

LGTM!

@caffeinated-pixels caffeinated-pixels merged commit 791b9a6 into master May 17, 2023
2 checks passed
@caffeinated-pixels caffeinated-pixels deleted the fix-persistent-targeting-values branch May 17, 2023 13:33
thedaviddias pushed a commit that referenced this pull request May 17, 2023
## [4.2.8](v4.2.7...v4.2.8) (2023-05-17)

### Bug Fixes

* persistent page-level targeting values ([#129](#129)) ([791b9a6](791b9a6))
@thedaviddias
Copy link
Member

🎉 This PR is included in version 4.2.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

3 participants