Who is online?
In total there are 2 users online :: 1 Registered, 0 Hidden and 1 Guest

Unknown Data

[ View the whole list ]


Most users ever online was 246 on Tue Jan 31, 2012 2:47 am
Statistics
We have 107 registered users
The newest registered user is KAN_GU_ROO

Our users have posted a total of 1539 messages in 169 subjects
Latest topics
» Welcome To AvacWeb!
by KAN_GU_ROO Today at 12:17 pm

» affiliate space???
by LGforum Today at 10:10 am

» Print a Particular Post
by ion-cube Mon Feb 20, 2012 6:45 am

» Tooltips..................
by CraZy.CloWn Wed Feb 15, 2012 3:03 am

» AvacDom Selector Method
by LGforum Tue Feb 14, 2012 11:08 pm

Adsense DOM insertion

View previous topic View next topic Go down

Adsense DOM insertion

Post by ion-cube on Wed Jan 25, 2012 8:24 pm

I am unable to insert the Adsense code to the #page-footer because FM don't allow us adding HTML there ...so we need to inject it. But I couldn't get the results.

this is the default html of adsense code:
Code:
<script type="text/javascript"><!--
google_ad_client = "ca-pub-xxxxxxxxxxxx";
/* EducationBottom */
google_ad_slot = "7723474639";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


I used something like
Code:
var script  = document.createElement("script");
var script2  = document.createElement("script");
script.type  = "text/javascript";
script2.type  = "text/javascript";
script.src  = "<"+"!--\ngoogle_ad_client = \"ca-pub-xxxxxxxxxxxx\";\n\/* EducationBottom *\/\ngoogle_ad_slot = \"7723474639\";\ngoogle_ad_width = 468;\ngoogle_ad_height = 60;\n\/\/--"+">"; 
script2.src  = "http://pagead2.googlesyndication.com/pagead/show_ads.js"; 
document.getElementById('page-footer').appendChild(script+script2);


used this for html to js conversion http://www.javxs.com

any help study

ion-cube

Status Status: Testing
Posts: 108
Join date: 2011-10-19
Age: 23
Location: Pakistan

View user profile

Back to top Go down

Re: Adsense DOM insertion

Post by LGforum on Wed Jan 25, 2012 9:00 pm

It isn't working, because look at the Javascript.

Specifically this:
Code:

script.src  = "<"+"!--\ngoogle_ad_client = \"ca-pub-xxxxxxxxxxxx\";\n\/* EducationBottom *\/\ngoogle_ad_slot = \"7723474639\";\ngoogle_ad_width = 468;\ngoogle_ad_height = 60;\n\/\/--"+">"; 


Its setting the scripts source rather than innerHTML.
Also, you must have the forumotion google adsense removed with credits before it will work, due to how google finds the ads.

LGforum

Status Status: Hope you like the new design of this board.
Forum Version: Phpbb3
Posts: 600
Join date: 2011-10-05
Location: UK

View user profile http://www.avacweb.com

Back to top Go down

Re: Adsense DOM insertion

Post by ion-cube on Wed Jan 25, 2012 10:41 pm

hmmm...
I am now working with an iframe method...& YES its successful

Also, you must have the forumotion google adsense removed with credits before it will work, due to how google finds the ads.

The same was said to me by Dion; but I think there is NOT the case. I have asked many FM members before this or Dion's forum was made that adsense code can be inserted in widget panel & they work ALONG WITH FM's ads

ion-cube

Status Status: Testing
Posts: 108
Join date: 2011-10-19
Age: 23
Location: Pakistan

View user profile

Back to top Go down

Re: Adsense DOM insertion

Post by LGforum on Thu Jan 26, 2012 5:53 pm

Strange. I would have thought that, the google information would only be sent and recieved from the first set. But I believe you.

Anyway, thanks for leting me know.

LGforum

Status Status: Hope you like the new design of this board.
Forum Version: Phpbb3
Posts: 600
Join date: 2011-10-05
Location: UK

View user profile http://www.avacweb.com

Back to top Go down

Re: Adsense DOM insertion

Post by Bilde on Thu Jan 26, 2012 6:12 pm

I think you can load multiple adsense's into one page.

Bilde

Posts: 54
Join date: 2011-11-04
Location: http://127.0.0.1/

View user profile

Back to top Go down

Re: Adsense DOM insertion

Post by ion-cube on Thu Jan 26, 2012 7:46 pm

Bilde wrote:I think you can load multiple adsense's into one page.
Not more than three

ion-cube

Status Status: Testing
Posts: 108
Join date: 2011-10-19
Age: 23
Location: Pakistan

View user profile

Back to top Go down

View previous topic View next topic Back to top


Permissions in this forum:
You cannot reply to topics in this forum