אחרי שתקבלו ותעתיקו את הקוד של יחידת המודעות, יהיה עליכם להדביק אותו בין התג <body>
לתג </body>
בדף. אם תדביקו את קוד המודעה מחוץ לתגי ה-<body>
, המודעות לא יוצגו כראוי.
טיפ: כדי לקבל עזרה בנושא HTML, אפשר לחפש משאבים שזמינים באינטרנט באמצעות מונחי חיפוש כמו "HTML basics" (עקרונות בסיסיים לעבודה עם HTML)
דף HTML לדוגמה, לפני הוספת הקוד של יחידת המודעות
<html>
<head>
זהו החלק העליון של הדף.
<title>דף HTML לדוגמה</title>
</head>
<body>
זה גוף הדף.
</body>
</html>
<head>
זהו החלק העליון של הדף.
<title>דף HTML לדוגמה</title>
</head>
<body>
זה גוף הדף.
</body>
</html>
דף HTML לדוגמה, לאחר הוספת הקוד של יחידת המודעות אל גוף הדף
<html>
<head>
זהו החלק העליון של הדף
<title>דף HTML לדוגמה</title>
</head>
<body>
זהו גוף הדף.
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1234567890123456" crossorigin="anonymous"></script>
<!-- Homepage Leaderboard -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1234567890123456"
data-ad-slot="1234567890"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</body>
</html>
<head>
זהו החלק העליון של הדף
<title>דף HTML לדוגמה</title>
</head>
<body>
זהו גוף הדף.
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1234567890123456" crossorigin="anonymous"></script>
<!-- Homepage Leaderboard -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1234567890123456"
data-ad-slot="1234567890"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</body>
</html>
הערה: זהו קוד לדוגמה בלבד, אין להשתמש בו ב-HTML של האתר שלכם.
קביעת המיקום של המודעות באתר באמצעות HTML
בדומה לתוכן אחר באתר (תמונות, פסקאות וכו'), תוכלו לשנות את המיקום של מודעות Google באמצעות תגי HTML (<div>
, <table>
וכו'). לדוגמה, אם מקיפים את קוד המודעה בתגי ה-HTML <div align="center">
ו-</div>
, המודעות יוצגו במרכז הדף.
<html>
<head>
זהו החלק העליון של הדף
<title>דף HTML לדוגמה</title>
</head>
<body>
זהו גוף הדף.
<div align="center">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1234567890123456" crossorigin="anonymous"></script>
<!-- Homepage Leaderboard -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1234567890123456"
data-ad-slot="1234567890"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</body>
</html>
<head>
זהו החלק העליון של הדף
<title>דף HTML לדוגמה</title>
</head>
<body>
זהו גוף הדף.
<div align="center">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1234567890123456" crossorigin="anonymous"></script>
<!-- Homepage Leaderboard -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1234567890123456"
data-ad-slot="1234567890"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</body>
</html>
הערה: זהו קוד לדוגמה בלבד, אין להשתמש בו ב-HTML של האתר שלכם.