Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: punchy - kesäkuu 08, 2019, 05:59:53 IP

Otsikko: Adsense Code
Kirjoitti: punchy - kesäkuu 08, 2019, 05:59:53 IP
Hi all  ;D

I need to add some adsense code between  the <head> and </head> tags on the front page of my forum what file can i do this with ?

This is the code

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


I tried putting it in the index template but got a 403 error syntax error

I need this code to add my adsense ads

Any help gratefully accepted
Otsikko: Re: Adsense Code
Kirjoitti: Kindred - kesäkuu 09, 2019, 07:09:11 AP
You cannot just randomly paste code into a PHP file. You have to put it into an Echo, either one that exists are ready or creating a new 1 in the proper location.
Otsikko: Re: Adsense Code
Kirjoitti: njtweb - kesäkuu 09, 2019, 01:40:35 IP
Lainaus käyttäjältä: punchy - kesäkuu 08, 2019, 05:59:53 IP
Hi all  ;D

I need to add some adsense code between  the <head> and </head> tags on the front page of my forum what file can i do this with ?

This is the code

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


I tried putting it in the index template but got a 403 error syntax error

I need this code to add my adsense ads

Any help gratefully accepted

Use the adsense mod or install a portal. You can put the adsense code where ever you want with a portal.