Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Urgent: Google Adsense Approval Script Code In Head

himanmahimanma New
edited February 2017 in Vanilla 2.0 - 2.8

I applied for google adsense yesterday. According to new Google Adsense aproval process google want me to add script in head.

" Paste it into the HTML of www.mywebsite.com, right after the <..head..> tag".
.
By this they mean the after first head tag in start of head, i saw example in their help section. i need to add script inside head.

Pocket add codes after and before head, so to place inside head I pasted code in my theme tpl and my site showed error, went offline. Then I enclosed script in literal in my theme tpl. Site Working fine. This is what i did.

<..head..>
{asset name="Head"}
{literal}

(adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-... i hide my id here ", enable_page_level_ads: true });

{/literal}
<../head..>

My question is. Do i have pasted right code enclosing in literal? adsense executive will be able to find the code in my forum html? How can i test? I am not a programmer, do copy paste by reading in community. Do not want to miss approval chance. Please guide.

I inspected in Firefox console it shows some google ads script, analytics and other scripts . But firebug do not show any js running.

Reason of confusion is: 8 hour ago i received email that i my application is successfully reviewed and i should create my first ad i.e blank ad. But when i visited adsense to create my first ad it still showing application is under review. my-ads section is not clickable yet. So i fear if i placed the code right. Before contacting them i want to be sure about this.

Tagged:

Comments

  • The head is above body there where is the metatags.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    @himanma said:
    My question is. Do i have pasted right code enclosing in literal?

    You need to enclose those separate scripts in separate {literal} tags each...

    {literal}<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>{/literal}
    
    {literal}<script>(adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-... i hide my id here ",     enable_page_level_ads: true }); </script>{/literal}
    
  • Ok thankyou,, will do that imediately

  • himanmahimanma New
    edited February 2017

    it worked perfect. I have a related query. Is currently there any way of inserting scripts in post while writing. i want to insert ad scripts in my first posts/comments. or will coming version offer this ability.

    Without ads in posts my ad-sense ctr is 0.7% only instead of normal 5% because most users are mobile, i use vanilla forum as community cum blog, mobile users from google search see only one ad above post inserted by pocket.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Scripts are not allowed in comments or discussions because they open you to hackers.

    Try the plugin AptAds , it was made specifically for ads.

    Depending on what mobile theme you use, the panel might not be showing and that would be a good place for ads on mobile.

  • Hi guys

    @vrijvlinder написал:
    Scripts are not allowed in comments or discussions because they open you to hackers.

    Is it possible to add google ads scripts in the tpl directly?

  • thanks @vrijvlinder will use pocket and apt ad to embed at proper places.

    @mirX yes you can at proper places inside tpl, but for non-developers like us i suggest test every change in theme on test website first

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    @mirX said:
    Hi guys

    @vrijvlinder написал:
    Scripts are not allowed in comments or discussions because they open you to hackers.

    Is it possible to add google ads scripts in the tpl directly?

    Yes , that is what he did. Look at the example above as to how to add script to a tpl template.

Sign In or Register to comment.