How to force advert to show on ajax-loaded page? (

2019-01-20 19:09发布

How can I force an advertisement to show on an ajax-loaded page? Because, as you may know, document.write(); used by AdSense is skipped in asynchronous requests.

I NEED to force that ad to be shown. I also searched on google help forum but with no luck. I found only this but that doesn't tell me anything (it's discontinued).

Note: I also found this topic but I'm not about to refresh these adverts, JUST to show them ! Tried if ($('#advert')){ eval($('#advert')); } before, does not work

Is that possible? Is there some workaround?

3条回答
祖国的老花朵
2楼-- · 2019-01-20 19:22

Load the page with the ads in a hidden iframe, and just get the contents of that when it's loaded.

I'm not sure it works with Google ad scripts specifically, but it seems to work with javascript in general.

查看更多
爷、活的狠高调
3楼-- · 2019-01-20 19:24

Sorry, but I think that way of showing AdSense violates Google's TOS. So even if you manage to do that, expect your account to be suspended some time later.

Edit:

Reference: it is already in the other answers https://www.google.com/adsense/localized-terms

Moreover, some time ago I tried to use ajax loaded page to show adsense and indeed they stopped the account. I also tried Iframe and again the account was suspended. Google don't give a *** until you start gaining $$$. So each time it took a while to suspend them. But thrust me they check each site manually at regular basis. So everytime I had to write many letters to google support to restore my accounts and it took a month to restore it and not before I fix the ads. I hate to be dark prophet, but I am pretty sure you will end like me if you mess with google's TOS. My personal advise is to revise your strategy.

I actually may go further and tell you that adsense payment is not very strict, and when something is wrong it is never in your favor. Many colleagues complain about the same, like uncounted clicks, unprovoked account suspensions (usually with significant money to check out), I also have one account that was never able to verify the address, because they don't send me the postcard and I made several requests and waited 2 months each time (for postal delays) and of course I have $$$'s to check out. So mate, don't try to cheat google, because more likely they will cheat you.

This is only my personal view and may contain some strong words that I'm not going to prove, because I'm not trying to start a discussion or accuse anyone.

Edit 2: I also can tell you why google do not allow asynchronous display of ads. Because you can manipulate the context (e.g. put hidden texts) and display non-relevant ads to your page, you can make google show only expensive ads which usually pay $1 per click (well google takes $4+ to the advertiser) and your context may only show $0.05 ads. Other way you could cheat is to simulate clicks or force the user click on ads.

查看更多
做自己的国王
4楼-- · 2019-01-20 19:38

Seems like they've stopped google adsense for ajax service now. However, loading ads with javascript is not allowed in google terms of service and may get you banned. https://www.google.com/adsense/localized-terms

You agree to comply with the specifications provided by Google from time to time to enable proper delivery, display, tracking, and reporting of Ads, Links, Search Results, Referral Buttons, and Google Brand Features (as defined in Section 12 below) in connection with Your Property(ies), including without limitation by not modifying the JavaScript or other programming provided to You by Google in any way, unless expressly authorized in writing by Google (including by electronic mail).

查看更多
登录 后发表回答