XF 2.0 Add Google adsense to Xenforo 2

Insomniaque

Member
Hello, first of all sorry for my rotten english..

I wanted to know how to add my little Google Adsens script on Xenforo 2.

Code:
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Annonces haut du site -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-gfdgfdgfdg"
     data-ad-slot="gfdgfdgfdgdf"
     data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

Regards,
A French speaker lost ..
 
Quite easy, but the Adsense-blocks are quite close to other content. I think google doesnt like this and can close your account for this, or?

How can I get some space (some cm) in between? :unsure:
 
Quite easy, but the Adsense-blocks are quite close to other content. I think google doesnt like this and can close your account for this, or?

How can I get some space (some cm) in between? :unsure:
You could use a css rule inline,
for example:
HTML:
<div style="padding-top: 10px">

here your snippet

</div>
 
Last edited:
You could use a css rule inline,
for example:
<div style = "padding-top: 10px">
here your snippet
</div>

When you create an adsense account it asks for this to be added;

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-8644111871674343",
enable_page_level_ads: true
});
</script>

Where do you add this before the ad code ?
 
When you create an adsense account it asks for this to be added;

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-8644111871674343",
enable_page_level_ads: true
});
</script>

Where do you add this before the ad code ?
If you have XF2 under setup you can find what you need
 
You cant do anything until the following is done per the adsense setup which you cannot do in setup.

Activating your account
This usually takes less than a day, but in some cases can take longer. We'll notify you when everything's ready.
Remember, place the code on every page you want ads.

Click “Show code” if you need to copy and paste the code again.

Paste it into the HTML of https://reptilezone.net, between the <head> and </head> tags
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-8644111871674343", enable_page_level_ads: true }); </script>
Copy Code
 
Back
Top Bottom