Search
Clear search
Close search
Google apps
Main menu

Override AdSense attributes in the tags on your page

In most cases, you'll have already set formatting for your AdSense ads in DFP or AdSense. However, if you want to override this formatting at the individual page level, you can insert the following code into your tags.

For asynchronous tags:

<script>
  googletag.cmd.push(function() {
    googletag.pubads().set("adsense_background_color", "FFFFFF");
  });
</script>

For synchronous tags:

<script>
  googletag.pubads().set("adsense_background_color", "FFFFFF");
</script>

To learn more about inserting AdSense attributes into your Google Publisher tags, see the API documentation for the .set() function.

Was this article helpful?
How can we improve it?