This project is read-only.

Google Adsense

Topics: General, Troubleshooting
Jan 9, 2014 at 8:25 PM
Hi I am new to this trying to learn Orchard and improve my MVC and ASP. Net knowledge.

When I drop some Google AdSense html into an aside widget and also to a footer. When I view the page the widgets only display the raw html such as

<script type="text/javascript"><!--
google_ad_client = "ca-pub-xxxxxxxxxxxxxxxx";
/ 2 /
google_ad_slot = "5436206944";
google_ad_width = 728;
google_ad_height = 90;
<script type="text/javascript"

The above code is for the footer and synchronous code but the async version produces the same result.

Am I missing something?

Thanks to all in advance
Jan 9, 2014 at 9:27 PM
Are you using an HTML widget? Or a custom one? If the former, paste the code when editing the source in TinyMCE. When from a custom widget, it should work, unless you output it with @ for some reason. If you want to echo this from a string, use Html.Raw().
Jan 9, 2014 at 10:13 PM
Thanks for the tip. Pasting into the html source id not work either, but by disabling TinyMCE I was able to get it working.

Many Thanks!