Welcome to WebmasterWorld Guest from 54.161.135.168

Forum Moderators: incrediBILL & martinibuster

Embedding Adsense Code with jQuery

Does it violate Adsense Program Policy?

   
7:50 am on Jul 7, 2012 (gmt 0)

10+ Year Member



I want to know if it is against the Adsense Program Policies to embed Adsense code using jQuery?

I want to append adsense code on my page dynamically after the first paragraph of content which can be done easily with jQuery.

Not too sure if it violates Adsense Program Policy?
8:03 am on Jul 7, 2012 (gmt 0)

10+ Year Member



Against the policy, and appending Adsense code wouldn't work.
8:17 am on Jul 7, 2012 (gmt 0)

WebmasterWorld Administrator incredibill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Against the policy, and appending Adsense code wouldn't work.


How does embedding dynamically vs. static embedding violate the policy?

It shouldn't be a problem that I'm aware of but it probably bears re-reading the policies to make sure, but as long as you aren't altering the code or doing anything forbidden like pop-ups, floating ads, etc. it should be fine.

I dynamically embed AdSense but I do it server side, not in Javascript, but which method is used shouldn't really matter IMO.

The only way to really be sure is to ask an AdSense rep.
4:22 am on Jul 8, 2012 (gmt 0)

10+ Year Member



jQuery is client-side. Appending the code itself won't even work. You can append an iframe that has the adsense code, but using iframe is against policy. Also you can switch to the DFP async code and call 'gpt.js' after appending the ad code, but as always best thing to do is to contact Adsense first..
4:58 am on Jul 8, 2012 (gmt 0)

WebmasterWorld Administrator incredibill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



You may want to translate the German if you can't read it, but here's one supposed solution to using jQuery with AdSense which is a year old so who knows if it still works:
[software-solutions-juergens.com...]

Whether it's permitted or not is another question, but it seems technically doable.
5:18 am on Jul 8, 2012 (gmt 0)

10+ Year Member



That solution moves the adsense iframe. If the OP meant that, I stand corrected. Otherwise, Adsense code uses document.write and AFAIK it's not possible to append it with jquery.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month