# We couldn't find the code on your site

**URL:** <https://meta.discourse.org/t/we-couldnt-find-the-code-on-your-site/118847>\
**Category:** Product Support\
**Tags:** advertising\
**Created:** [May 28, 2019, 7:36am UTC](https://meta.discourse.org/t/we-couldnt-find-the-code-on-your-site/118847 "2019-05-28T07:36:16Z")\
**Posts on this page:** 10\
**Page:** 1

## AI-generated summary

The discussion revolves around [Viki](/t/-/118847/1) having trouble implementing **Adsense** on their Discourse site due to an error. [Chaboi_3000](/t/-/118847/2) suggests this is likely due to in-line JavaScript being blocked by Discourse for security reasons. [Chaboi_3000](/t/-/118847/4) recommends using the Google Adsense plugin, which [Viki](/t/-/118847/5) is already using. [Chaboi_3000](/t/-/118847/6) then realizes the issue and provides instructions on how to configure the plugin, but [Viki](/t/-/118847/7) notes that the details cannot be filled in until **Google** Adsense approval is received.

<div class="post-metadata">

**Author:** ![Viki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/viki/32/131139_2.png) [@Viki](https://meta.discourse.org/u/Viki)\
**Post date:** [May 28, 2019, 7:36am UTC](https://meta.discourse.org/t/we-couldnt-find-the-code-on-your-site/118847/1 "2019-05-28T07:36:16Z")

</div>

Hello,  
I have applied **Adsense** for my discourse site.  
I pasted the Adsense code in `</head>` section.  
**Google** responses with

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/5/e5b444a8332056bf27a0e3e66eca63db66e07284.png)

**Error logs shows**

![image](https://global.discourse-cdn.com/meta/original/3X/e/0/e0bd56b09824489509820c01e854f1c0a7fe99dd.png)

---

<div class="post-metadata">

**Author:** ![Chaboi\_3000](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chaboi_3000/32/163015_2.png) [@Chaboi\_3000](https://meta.discourse.org/u/Chaboi_3000)\
**Post date:** [May 28, 2019, 7:47am UTC](https://meta.discourse.org/t/we-couldnt-find-the-code-on-your-site/118847/2 "2019-05-28T07:47:44Z")

</div>

It’s because you’re trying to run in-line JavaScript, which can cause some problems. This is why Discourse has removed it. For more information, go here:

> [@Mitigate XSS Attacks with Content Security Policy](https://meta.discourse.org/t/mitigate-xss-attacks-with-content-security-policy/104243):
>
> bookmark This guide explains how to use Content Security Policy (CSP) to mitigate Cross-Site Scripting (XSS) attacks in Discourse. It covers CSP basics, configuration, and best practices. person_raising_hand Required user level: Administrator Summary Content Security Policy (CSP) is a crucial security feature in Discourse that helps protect against Cross-Site Scripting (XSS) and other injection attacks. This guide covers the basics of CSP, how it’s implemented in Discourse, and how to c…

---

<div class="post-metadata">

**Author:** ![Viki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/viki/32/131139_2.png) [@Viki](https://meta.discourse.org/u/Viki)\
**Post date:** [May 28, 2019, 7:48am UTC](https://meta.discourse.org/t/we-couldnt-find-the-code-on-your-site/118847/3 "2019-05-28T07:48:19Z")

</div>

Thank you @Chaboi_3000

---

<div class="post-metadata">

**Author:** ![Chaboi\_3000](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chaboi_3000/32/163015_2.png) [@Chaboi\_3000](https://meta.discourse.org/u/Chaboi_3000)\
**Post date:** [May 28, 2019, 7:49am UTC](https://meta.discourse.org/t/we-couldnt-find-the-code-on-your-site/118847/4 "2019-05-28T07:49:52Z")

</div>

Oh, and @Viki, you can use this plugin in your site for AdSense. I think this should help with your In-line JS problem:  
[https://meta.discourse.org/t/google-adsense-plugin/11763](https://meta.discourse.org/t/google-adsense-plugin/11763)

---

<div class="post-metadata">

**Author:** ![Viki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/viki/32/131139_2.png) [@Viki](https://meta.discourse.org/u/Viki)\
**Post date:** [May 28, 2019, 7:57am UTC](https://meta.discourse.org/t/we-couldnt-find-the-code-on-your-site/118847/5 "2019-05-28T07:57:13Z")

</div>

I am using `discourse-adplugin`  
[https://github.com/discourse/discourse-adplugin](https://github.com/discourse/discourse-adplugin)  
I disabled CSP & CSPR reports.

---

<div class="post-metadata">

**Author:** ![Chaboi\_3000](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chaboi_3000/32/163015_2.png) [@Chaboi\_3000](https://meta.discourse.org/u/Chaboi_3000)\
**Post date:** [May 28, 2019, 8:09am UTC](https://meta.discourse.org/t/we-couldnt-find-the-code-on-your-site/118847/6 "2019-05-28T08:09:59Z")

</div>

> [@Viki](#):
>
> I disabled CSP & CSPR reports.

Never mind. I’m sorry. I messed that up. 😟 You just have to go to `https://example-forum.com/admin/site_settings/category/adsense_plugin` and fill in the details and follow the steps here:  
[https://github.com/discourse/discourse-adplugin#step-2b---input-your-details](https://github.com/discourse/discourse-adplugin#step-2b---input-your-details)

---

<div class="post-metadata">

**Author:** ![Viki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/viki/32/131139_2.png) [@Viki](https://meta.discourse.org/u/Viki)\
**Post date:** [May 28, 2019, 8:24am UTC](https://meta.discourse.org/t/we-couldnt-find-the-code-on-your-site/118847/7 "2019-05-28T08:24:00Z")

</div>

No problem @Chaboi_3000 🙂  
I think we have to fill the details after we get Adsense approval from Google.

---

<div class="post-metadata">

**Author:** ![Chaboi\_3000](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chaboi_3000/32/163015_2.png) [@Chaboi\_3000](https://meta.discourse.org/u/Chaboi_3000)\
**Post date:** [May 28, 2019, 8:55am UTC](https://meta.discourse.org/t/we-couldnt-find-the-code-on-your-site/118847/8 "2019-05-28T08:55:08Z")

</div>

You might want to contact Google about that. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [October 18, 2022, 2:08pm UTC](https://meta.discourse.org/t/we-couldnt-find-the-code-on-your-site/118847/9 "2022-10-18T14:08:59Z")

</div>

Automatically bumped on October 18, 2022, 2:08pm UTC



---

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [October 18, 2022, 2:15pm UTC](https://meta.discourse.org/t/we-couldnt-find-the-code-on-your-site/118847/10 "2022-10-18T14:15:10Z")

</div>

Closed on October 18, 2022, 2:15pm UTC


