What exactly does this Google Adense code do?

Hey, I'm trying to expand my knowledge of javascript and wondered if anyone could explain to me what exactly is happening in the script below:

<– Begin Google Adsense code –>
<script type="text/javascript">
google_ad_client = "ad-client-code-goes-here";
google_ad_slot = "ad-slot-code-goes-here";
google_ad_width = 300;
google_ad_height = 250;
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<– End Google Adsense code –>

Most importantly, why is there 4 'google_ ad _...' at the beginning and what is their purpose?

The string explanation will be awesome :)

Thanks for any help. I really appreciate that.

+3
source share
1 answer

Google_ad ... - variables (link this code to your account, set the width / height of the ad, etc.). They are set for the script (show_ads.js), which will later be loaded.

For a full description of variables, see CyberNAC Javascript Variables Used in Adsense .

+3

Source: https://habr.com/ru/post/1715519/


All Articles