# How to insert Google Admobe code to \<head\> tag

**URL:** https://meta.discourse.org/t/how-to-insert-google-admobe-code-to-head-tag/155691
**Category:** Support
**Created:** [June 23, 2020, 2:18pm UTC](https://meta.discourse.org/t/how-to-insert-google-admobe-code-to-head-tag/155691 "2020-06-23T14:18:31Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![sharkdeng](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sharkdeng/32/184854_2.png) [@sharkdeng](https://meta.discourse.org/u/sharkdeng)
#### Post date: [June 23, 2020, 2:18pm UTC](https://meta.discourse.org/t/how-to-insert-google-admobe-code-to-head-tag/155691/1 "2020-06-23T14:18:31Z")

</div>

Hello, I want to insert Google Admobe to my website [edu3d.co](http://edu3d.co)

It requires to insert one peice of code into tag.

How to do that?

Thank you!

---

<div class="post-metadata">

### Author: ![Qursch](https://avatars.discourse-cdn.com/v4/letter/q/c37758/32.png) [@Qursch](https://meta.discourse.org/u/Qursch)
#### Post date: [June 23, 2020, 2:43pm UTC](https://meta.discourse.org/t/how-to-insert-google-admobe-code-to-head-tag/155691/2 "2020-06-23T14:43:38Z")

</div>

You should be able to create a custom component, then add HTML into the head tag.

---

<div class="post-metadata">

### Author: ![sharkdeng](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sharkdeng/32/184854_2.png) [@sharkdeng](https://meta.discourse.org/u/sharkdeng)
#### Post date: [June 23, 2020, 2:47pm UTC](https://meta.discourse.org/t/how-to-insert-google-admobe-code-to-head-tag/155691/3 "2020-06-23T14:47:13Z")

</div>

Hello, after looking for ‘ + discourse’, I found this post is really helpful!!

> [@Custom javascript in \<head\> disappear](https://meta.discourse.org/t/custom-javascript-in-head-disappear/144356/3):
>
> It does not “disappear” it’s still there. What happens is that we pull all inline scripts and put them in one file for your theme. [discourse/app/models/theme\_field.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/app/models/theme_field.rb#L73-L128) So, if you search the page-source for theme-javascript you should see something like this [theme javascript file] This file will contain all of your inline scripts. Also, Discourse has native support for Google Analytics, so why not use that? Search the settings for Analytics

It also explains why script in would disappear and discourse support Google Analytics.

---

<div class="post-metadata">

### Author: ![sharkdeng](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sharkdeng/32/184854_2.png) [@sharkdeng](https://meta.discourse.org/u/sharkdeng)
#### Post date: [June 23, 2020, 2:49pm UTC](https://meta.discourse.org/t/how-to-insert-google-admobe-code-to-head-tag/155691/4 "2020-06-23T14:49:25Z")

</div>

I set the customized setting according to the following instruction `https://meta.discourse.org/t/custom-javascript-in-head-disappear/144356/3` , Google Admob says it cannot detect my code now, but I found the script in page source. So I am gonna wait for 2 weeks to see what happen. Also, I am gonna add Google Analytics to my website.

---

<div class="post-metadata">

### Author: ![Qursch](https://avatars.discourse-cdn.com/v4/letter/q/c37758/32.png) [@Qursch](https://meta.discourse.org/u/Qursch)
#### Post date: [June 23, 2020, 2:56pm UTC](https://meta.discourse.org/t/how-to-insert-google-admobe-code-to-head-tag/155691/5 "2020-06-23T14:56:14Z")

</div>

When you find your script in the page source, is it’s source (src) different from when you added it yourself? If so, Google Admob may be looking for the wrong script.

---

<div class="post-metadata">

### Author: ![sharkdeng](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sharkdeng/32/184854_2.png) [@sharkdeng](https://meta.discourse.org/u/sharkdeng)
#### Post date: [June 23, 2020, 3:03pm UTC](https://meta.discourse.org/t/how-to-insert-google-admobe-code-to-head-tag/155691/6 "2020-06-23T15:03:03Z")

</div>

If it is just a src={link} in , then this line of code is same.  
If it is script, then discourse will convert it into a theme-link. This line of code is not same.  
Not sure If Google Admob will accept this.

---

<div class="post-metadata">

### Author: ![sharkdeng](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sharkdeng/32/184854_2.png) [@sharkdeng](https://meta.discourse.org/u/sharkdeng)
#### Post date: [June 23, 2020, 3:13pm UTC](https://meta.discourse.org/t/how-to-insert-google-admobe-code-to-head-tag/155691/7 "2020-06-23T15:13:00Z")

</div>

How to know if my Google Admob and Google Analytics are setting correct? I’ve done them both.

---

<div class="post-metadata">

### Author: ![Qursch](https://avatars.discourse-cdn.com/v4/letter/q/c37758/32.png) [@Qursch](https://meta.discourse.org/u/Qursch)
#### Post date: [June 23, 2020, 3:14pm UTC](https://meta.discourse.org/t/how-to-insert-google-admobe-code-to-head-tag/155691/8 "2020-06-23T15:14:45Z")

</div>

Yes, I know.

That is why I suggested that you should see if you can tell Google specifically what to look for.

---

<div class="post-metadata">

### Author: ![sharkdeng](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sharkdeng/32/184854_2.png) [@sharkdeng](https://meta.discourse.org/u/sharkdeng)
#### Post date: [June 23, 2020, 8:43pm UTC](https://meta.discourse.org/t/how-to-insert-google-admobe-code-to-head-tag/155691/10 "2020-06-23T20:43:14Z")

</div>

# Adscene

I got this page for Adscene (Admob is for mobile)

 ![Screen Shot 2020-06-24 at 6.40.15 AM](https://global.discourse-cdn.com/meta/original/3X/7/9/795b213bded87a00e4135d5b9f1d7fb92960bc00.png)

This are the scripts in my page source code

 ![Screen Shot 2020-06-24 at 6.45.52 AM](https://global.discourse-cdn.com/meta/original/3X/f/f/ff7af67b108064574b4f6c087ba56d228a97406d.png)

# Analytics

And I got this page for Analytics

 ![Screen Shot 2020-06-24 at 6.27.14 AM](https://global.discourse-cdn.com/meta/original/3X/0/d/0dcd00b5b46f71e2cbdf8ca0f241702407afe110.png)

# Discourse Ad support

I add found this [GitHub - discourse/discourse-adplugin: Official Discourse Advertising Plugin. Install & Start Serving Ads on Your Discourse Forum · GitHub](https://github.com/discourse/discourse-adplugin?utm_campaign=341&utm_impression=17eaa3e8-6004-4731-98ba-f2bb86d5710c&utm_medium=display&utm_referrer=https%3A%2F%2Fmeta.discourse.org%2F&utm_source=CodeFund) to get this effect

 ![Screen Shot 2020-06-24 at 7.14.47 AM](https://global.discourse-cdn.com/meta/original/3X/f/a/fa872b76657375d5eb835a85a25df187d3f4c1b4.png)
