If you've met the requirements of our Consent Policy and you want to serve non-personalized ads to all users located in the European Economic Area or the UK who visit your site, no changes to your ad tagging are needed. You can enable non-personalized ad serving in the AdSense or Google Ad Manager UIs.
However, if you have specific requirements, for example, you want to serve some users personalized ads, and other users non-personalized ads, you might want to consult the examples below.
Ad code for non-personalized ads
If you'd like to serve non-personalized ads on a per page basis, consult the example below:
// The line above makes sure you are requesting non-personalized ads. It needs to come before you use and it suffices to have one such line per page.
data-ad-client="ca-pubxxx"
data-ad-slot="slot_id">
data-ad-client="ca-pubxxx"
data-ad-slot="slot_id">
// This triggers the ad request.
Ad code for personalized ads
If you want to serve some users personalized ads, and other users non-personalized ads, consult the example below:
// This will pause ad requests, so users have time to interact with your consent solution.
/* Set up the consent solution and act according to the user choice.
If the user declines personalized ads, make sure to call (adsbygoogle=window.adsbygoogle||[]).requestNonPersonalizedAds=1;
Remember that you need user consent for using cookies even for non-personalized ads in countries where the EU eprivacy directive requires it.
Later, you can call (adsbygoogle=window.adsbygoogle||[]).pauseAdRequests=0 to resume sending ad requests. Without making this call, no ads will be shown.
*/
data-ad-client="ca-pubxxx"
data-ad-slot="slot_id">
data-ad-client="ca-pubxxx"
data-ad-slot="slot_id">
// This usually triggers the ad request, but you have paused these.
Auto ads: ad code for non-personalized ads
If you'd like to serve non-personalized Auto ads on a per page basis, consult the example below:
Auto ads: ad code for personalized ads
If you want to serve some users personalized Auto ads, and other users non-personalized Auto ads, consult the example below: