Can I add a line associated with 'google_ad_host' to the ad script?

99 views
Skip to first unread message

이준호

unread,
Aug 1, 2013, 1:51:12 AM8/1/13
to adsen...@googlegroups.com

Hello.

I've got an ad script in Google Adsense service page.

this is below:

1.

<script type="text/javascript"><!--

google_ad_client = "ca-pub-1234567890";

/* 120x600_Region/House */

google_ad_slot = "xxxxxxxxxxx";

google_ad_width = 120;

google_ad_height = 600;

//-->

</script>

<script type="text/javascript"

src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

</script>



And the following ad script is what I've got using adsense host api:

2.

<script type="text/javascript"><!--

google_ad_client = "ca-pub-0987654321";

google_ad_host = "ca-host-pub-1357924680";

/* Web 200x300 */

google_ad_slot = "yyyyyyyyyy";

google_ad_width = 250;

google_ad_height = 250;

//-->

</script>

<script type="text/javascript"

src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

</script>


There is a difference between scripts(first script has no 'google_ad_host = ca-host-pub-1357924680', but second script has), so I'd like to add 'google_ad_host = ca-host-pub-1357924680' to the second script.


At this moment, I have a question. If I add the line, does the second script work properly? I wonder if google's 'earning distribution process' will work normally in this case.


Thank you.

Jose Alcérreca (AdSense API Team)

unread,
Aug 1, 2013, 7:21:10 AM8/1/13
to adsen...@googlegroups.com
Hi,

I guess you want to add that parameter to the first script, not the second. 

Always use the getAdCode method to retrieve generated ad code (you must cache or store it somewhere, not call getAdCode for every impression). You shouldn't modify the script manually as their structure can change without notice.

Cheers,
Jose

---
Jose Alcérreca
Developer Relations

Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ
Registered in England Number: 3977902

이준호

unread,
Aug 2, 2013, 5:10:37 AM8/2/13
to adsen...@googlegroups.com
Thank you for your comment.

But I still wonder if google's 'earning distribution process' will work normally in this case.

I know that modifying the script manually is an unsuitable way, but I want to know that whether earning is distributed properly when the line(google_ad_host = ca-host-pub-1357924680) is added to the first(sorry, I made a mistake) script.

Thanks, Jose.

Jose Alcérreca (AdSense API Team)

unread,
Aug 2, 2013, 7:07:54 AM8/2/13
to adsen...@googlegroups.com
Hi,

I can't guarantee normal operation if you modify the code manually, I'm afraid. The host and the publisher accounts must be associated first, it's not just a line in the Javascript. Use the getAdCode method.

Cheers,
Jose

---
Jose Alcérreca
Developer Relations

Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ
Registered in England Number: 3977902


Reply all
Reply to author
Forward
0 new messages