googleads/google-publisher-tag-samples

Sample feedback: basic/configure-personalized-ads

Letme opened this issue · 1 comments

Letme commented

The personalized adds configuration uses deprecated functions as it seems:

The following functions are deprecated: googletag.pubads().setTagForChildDirectedTreatment(), googletag.pubads().clearTagForChildDirectedTreatment(), googletag.pubads().setRequestNonPersonalizedAds(), and googletag.pubads().setTagForUnderAgeOfConsent(). Please use googletag.pubads().setPrivacySettings() instead.

Thanks for reporting this @Letme. While setRequestNonPersonalizedAds() technically still works, the PrivacySettings API should be used instead:

// Disable personalized ads.
googletag.pubads().setPrivacySettings({
  nonPersonalizedAds: true
});


// Enable personalized ads.
googletag.pubads().setPrivacySettings({
  nonPersonalizedAds: false
});

I'll get the sample updated to reflect this shortly.