AdSense


Andy

Administrator
This thread explains how to get your Google AdSense code and how to enter it into the Advertising system in your Admin control panel.
 

Andy

Administrator
Getting your AdSense code.

Google AdSense offers a responsive code, but don't use it. Your ads will be huge and there's no way to control the size. Instead select the fixed code, that will allow you to select a maximum size which will still reduce in size when in responsive view.

AdSense -> Ads -> By ad unit -> Display ads -> Horizontal -> Ad size = Fixed -> 728 x 90
 

Andy

Administrator
Creating the Advertising code.

Admin control panel ->Setup -> Advertising

To show your AdSense in the most important areas I suggest creating two Advertising areas like this:

1588606245582.png
 

Andy

Administrator
Container breadcrumb (top): Above

Code:
<xf:if is="$xf.reply.template == 'forum_list'">
    <center>
    <div style="margin-top:10px;margin-bottom:15px;">
        <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
        <!-- fixed 728x90 -->
        <ins class="adsbygoogle"
             style="display:inline-block;width:728px;height:90px"
             data-ad-client="ca-pub-1234"
             data-ad-slot="1234"></ins>
        <script>
             (adsbygoogle = window.adsbygoogle || []).push({});
        </script>
    </div>
    </center>
</xf:if>

<xf:if is="$xf.reply.template == 'forum_view'">
    <center>
    <div style="margin-top:10px;margin-bottom:15px;">
        <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
        <!-- fixed 728x90 -->
        <ins class="adsbygoogle"
             style="display:inline-block;width:728px;height:90px"
             data-ad-client="ca-pub-1234"
             data-ad-slot="1234"></ins>
        <script>
             (adsbygoogle = window.adsbygoogle || []).push({});
        </script>
    </div>
    </center>
</xf:if>

<xf:if is="$xf.reply.template == 'thread_view'">
    <center>
    <div style="margin-top:10px;margin-bottom:15px;">
        <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
        <!-- fixed 728x90 -->
        <ins class="adsbygoogle"
             style="display:inline-block;width:728px;height:90px"
             data-ad-client="ca-pub-1234"
             data-ad-slot="1234"></ins>
        <script>
             (adsbygoogle = window.adsbygoogle || []).push({});
        </script>
    </div>
    </center>
</xf:if>
1588606429187.png
 

Andy

Administrator
Container breadcrumb (bottom): Above

Code:
<xf:if is="$xf.reply.template == 'forum_list'">
	<center>
	<div style="margin-top:20px;margin-bottom:10px;">
		<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
		<!-- fixed 728x90 -->
		<ins class="adsbygoogle"
			 style="display:inline-block;width:728px;height:90px"
			 data-ad-client="ca-pub-1234"
			 data-ad-slot="1234"></ins>
		<script>
			 (adsbygoogle = window.adsbygoogle || []).push({});
		</script>
	</div>
	</center>
</xf:if>

<xf:if is="$xf.reply.template == 'forum_view'">
	<center>
	<div style="margin-top:20px;margin-bottom:10px;">
		<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
		<!-- fixed 728x90 -->
		<ins class="adsbygoogle"
			 style="display:inline-block;width:728px;height:90px"
			 data-ad-client="ca-pub-1234"
			 data-ad-slot="1234"></ins>
		<script>
			 (adsbygoogle = window.adsbygoogle || []).push({});
		</script>
	</div>
	</center>
</xf:if>

<xf:if is="$xf.reply.template == 'thread_view'">
	<center>
	<div style="margin-top:0px;margin-bottom:0px;">
		<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
		<!-- fixed 728x90 -->
		<ins class="adsbygoogle"
			 style="display:inline-block;width:728px;height:90px"
			 data-ad-client="ca-pub-1234"
			 data-ad-slot="1234"></ins>
		<script>
			 (adsbygoogle = window.adsbygoogle || []).push({});
		</script>
	</div>
	</center>
	<br />
</xf:if>
 
Thread starter Similar threads Forum Replies Date
Andy AdSense policies Search Optimization 0
Andy Understanding & setting up AdSense Auto ads General 5
Andy How to add AdSense to the header General 11
Top