Q2A Market - Support

We are here to provide you support for Q2A Market premium and free products. If you have any issue in installation, option settings or any bug you found. Please create a ticket. We would try to get back to you as soon as possible.

addsense code in frontpage

I tried to put google addsense code in a column defined as custom html but with no success (showing code and not adv)
is there a way to put adsense code?
thank you

opened on Oct 27 in Front Page

1 Answer

 
Best answer

As per my understanding Google Addsense code containing Javascript which doesn't render directly but by referring the element id.

You can try by adding Addsense javascript into theme file and just add html element with defined ID to the Front Page HTML column.

However to provide you more details, I required your code and the detail how exactly you are approaching.

answered Oct 27
selected Nov 6

Hi,
this is and example of my google adsense code:

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- lamakama-after-question -->
<ins class="adsbygoogle"
     style="display:inline-block;width:336px;height:280px"
     data-ad-client="ca-pub-8685177900787665"
     data-ad-slot="9096041540"></ins>
<script>
</script>

I also tried to insert it as a php code according to the example here with this code:

<?php
//assign adsense code to a variable
$googleadsensecode = '
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- lamakama-after-question -->
<ins class="adsbygoogle"
     style="display:inline-block;width:336px;height:280px"
     data-ad-client="ca-pub-8685177900787665"
     data-ad-slot="9096041540"></ins>
<script>
</script>';
//now outputting this to HTML
echo $googleadsensecode;
?>

but it didn't succeed. i am not a php programmer so maybe i miss something.

can you advise me a solution?
thank you

code don't show up well but if you open it for edit, you can see what i ment

Which theme you are using? Is that Snow or any other?

I am using max control theme

I see, the inline javascript doesn't support currently in HTML is now supported. I will try to add provision in next version.
This required some additional development to support inline javascript. Apart from Front Page you may like to use our free Simple Advert plugin. Most of the users using adsense code into that plugin to display adds between questions.