I have this adsense ad code:

<script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"


What is a data-ad-slot for Google Adsense and why is inline styling required — aren't all ads have a fixed mobile-first styling?

This question is very much a follow up to this question.

1 Answer 1


When you create an Adsense ad, you can select it to be either responsive or fixed size.

If it's a fixed size, you'll get the sizing thrown into the ad as part of the styling:


However, if you choose a responsive size, it will display something like this:


If you don't want to use inline styling, you can skip the style tag all together and define it on your css, for example:

<ins class="adsbygoogle myadstyle"

And in your css add something like:


Regarding your second question, data-ad-slot is the code for the ad unit you've created. If you go to Ads > Ad Units, you'll see all the ads you've created for your account. Each of those has a unique ID which is the value used for that field.

  • Let's say I used the same ad code twice in a single page in order to show two ads, will revenue from the 2nd ad be generated? I had read somewhere in the web that using the same data-ad-slot will not generate any revenue and will only be counted as one.
    – JAT86
    Commented Aug 25, 2019 at 21:27
  • 2
    @JAT86 You can place the same code multiple times on the page, revenue will generate for each individually, however you won't be able to track which of them generated the revenue. For tracking purposes, you can either create a different ad with a different ad-slot and track it there, or use tracking channels. Commented Aug 27, 2019 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.