I have Google ads set up so that premium members don't see them. This works fine but when I turn on Google auto ads they start seeing anchor ads, they don't see any other auto ads it's just the anchor ones that seem to bypass the group permissions.
<xf:if is="{{!$xf.visitor.isMemberOf(X)}}">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1234567891234567" crossorigin="anonymous"></script>
</xf:if>
<xf:if is="{{!$xf.visitor.isMemberOf(X)}}">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1234567891234567" crossorigin="anonymous"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-1234567891234567",
enable_page_level_ads: true,
overlays: {bottom: true}
});
</script>
</xf:if>
This is great thanks. I did wonder if we could somehow get anchor ads to show at the bottom. Is this not against Google's rules?You need to surround your main Google Adsense Code with a conditional so it does not run for your premium members group. Place your premium members group ID below in the first line in place of X.
PHP:<xf:if is="{{!$xf.visitor.isMemberOf(X)}}"> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1234567891234567" crossorigin="anonymous"></script> </xf:if>
Google's anchor ads have no dedicated position, so there is no way other way currently to turn them off for selected users then to do what is shown above.
You may also find forcing anchor ads to be on the bottom only a better experience for XenForo users. Mobile anchor ads that show on the top can cause issues with floating menus like XenForo's. The code below will force all anchor ads to the bottom of the page (for both desktop and mobile, there is no way currently to target them differently).
PHP:<xf:if is="{{!$xf.visitor.isMemberOf(X)}}"> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1234567891234567" crossorigin="anonymous"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-1234567891234567", enable_page_level_ads: true, overlays: {bottom: true} }); </script> </xf:if>
This is great thanks. I did wonder if we could somehow get anchor ads to show at the bottom. Is this not against Google's rules?
Perfect thanks. It seems though that the anchor ads are still showing at the top.It is their rule or I should say an acceptable modification to their rule that does not violate the AdSense Program policies...
Disable anchor ads at the top of your page - Google AdSense Help
Modify your ad code so anchor ads only appear at the bottom of a page #disableanchorads You can prevent anchor adssupport.google.com
Could take up a little time to see results due to script caching. It's been awhile now so you should be seeing the change.Perfect thanks. It seems though that the anchor ads are still showing at the top.
Try this (haven't tried it): https://www.thecodehubs.com/detect-chrome-extension-using-js/Is there a way to detect if users are using a specific chrome extension?
Ads Manager has an adblock detection feature with various options.Apparently there is an extension blocking ads on a couple of sites, and we're on their blacklist
Thanks!Try this (haven't tried it): https://www.thecodehubs.com/detect-chrome-extension-using-js/
Yes, we're using the adblock detection options.Ads Manager has an adblock detection feature with various options.
@Siropu Is there any way currently to truncate the ad statistics older than a certain date?
The stats_click table can get quite large and old detailed ad data for most admins is stale and not very useful.
After a certain amount of time it is of no benefit for some admins to know the exact views or clicks for an ad position from like 3 years ago. This will be different for everyone I know. Keeping on ongoing total count of views and clicks can be useful. Seems there may be a more efficient way to keep detailed statistics of recent ad views and clicks, and then possibly using updating records in an archive table for long term "total" statistics?
Just some thoughts I was having as I saw the size of the stats_click table.
Somehow I forgot to implement those options in the code.What cron cleans these up?
Somehow I forgot to implement those options in the code.
Improved click accuracy for banner ads or code ads that uses html link ads.
Table optimization if needed when deleting statistics.
Bugs Fixed
Missing cron jobs for admin options "Delete click statistics older than" and "Delete daily statistics older than".
Issue with tracking views when using footer fixed position.
Sticky sidebar might be useful so the ads stays in view as you scroll.Hi, one wish is that the adserver could have a way to know a long page vs. a short page. I am usure how to make the most of pages when they go longer.
It wouldn't quite work in my situation. I'm thinking more like as the page loads if page = x length serve 2 ads, if page length = xl length serve 3 ads. maybe it can be done with some sort of widget coding then put the ad in a widget?Sticky sidebar might be useful so the ads stays in view as you scroll.
We use essential cookies to make this site work, and optional cookies to enhance your experience.