[OzzModz] Google Adsense tips and visual overview of ad positions

[OzzModz] Google Adsense tips and visual overview of ad positions

Is there a conditional for "if a notice is showing to a user"?
I set a notice for members who is registered more than a months and still has 0 posts. I would like to show ads for them also (I don't show ads for members).
Don't post - get ads. Don't want ads - post. )
 
Is there a conditional for "if a thread is older than a year"? I want to figure out if old or new threads make me the most of money.
 
Is there a conditional for "if a notice is showing to a user"?
I set a notice for members who is registered more than a months and still has 0 posts. I would like to show ads for them also (I don't show ads for members).
Don't post - get ads. Don't want ads - post. )
I don't know about this one. Probably needs some extra code / add-on to do this. I couldn't find a way with existing variables.

Is there a conditional for "if a thread is older than a year"? I want to figure out if old or new threads make me the most of money.
If you display the ad in threads:
Code:
<xf:if is="$xf.time - $thread.post_date > 31536000">TEST</xf:if>

If you display the ad in posts:
Code:
<xf:if is="$xf.time - $post.post_date > 31536000">TEST</xf:if>

In both cases it will use the start date of the thread.
This is the easiest way using timestamp "365 * 86400 = 31536000" which means it is not always EXACTLY one year (for example when you are in a leap year), but I think it is good enough.
 
I don't know about this one. Probably needs some extra code / add-on to do this. I couldn't find a way with existing variables.
In my case, when the system shows a notice to members who are registered for more than 30 days and has 0 post, I could set ads not for " if a notice is showing to a user " but for "visitor is registered for more than 30 days and has 0 post". Is this one is doable?
 
I was thinking about that too but couldn't find the right vars... but it seems possible!
Try this:
Code:
<xf:if is="!$xf.visitor.message_count AND $xf.time - $xf.visitor.register_date > 2592000">TEST</xf:if>
 
Last edited:
Several months ago I had to disable adsense. I had a skyrocket in click through ratio, was around 0.3 to 0.7% and one day that jumped to over 4%. So I reported myself to google using their form specifically for this and I turned my adsense off to protect my account. Recently, I turned it back on, but I'm still seeing a fairly heavy click through ratio, around 2% and I have even disabled my in feed, after first before last ads, only have one displayed at the very bottom of the page, Container Content: Below.

Has anyone experienced something similar and how to solve this problem? I'm afraid its abuse or bots or just really silly people touching ads?
 
Has anyone experienced something similar and how to solve this problem? I'm afraid its abuse or bots or just really silly people touching ads?
I had. CTR jumped to 10%. I found it and banned by IP.
Go to Google Analytics->Audience->Geo->Location
Click 'AdSense'

0.jpg

Find the country with biggest AdSense CTR. Click it and find the city.
But we are probably flooding here hijacking the topic.
 
What about a conditional to not show ads on specific categories and all its forum children?
Thanks!
did anybody ever found a solution to this?

...the xenforo ads system needs a "node" section under "Display criteria" IMO!
 
I have a subscription site, subscribers see few ads, non-subscribers see AdSense all over the place. Above, within and below content. All adverts are responsive and placed via ads Manager, I watch my Adsense carefully. I've never seen those invalid activity adjustments, not once. Revenue slowed during lockdown but last month was just off a site record.
 
It'd be great if this resource was updated to show screenshots of the forum in a responsive view, like in the smallest viewport. I noticed that they bounced around quite a bit.

Also, kind of off topic, I got a notification from Google to implement this portion of code in my AdSense units:
data-full-width-responsive="true"
...which presumably shows an ad that won't appear smaller on a mobile device than a selected 720x90 ad will.
 
Also, kind of off topic, I got a notification from Google to implement this portion of code in my AdSense units:
I think this is a recommendation?

Setting data-full-width-responsive to true will result in HUGE square ads in your mobile content. Personally I didn't like this as it was way to intrusive. To prevent this, I have set this to false for the 'in between' ads, and only the bottom ad has data-full-width-responsive=true.
 
  • Like
Reactions: frm
This code for After first post location:
Code:
$post.position % $xf.options.messagesPerPage == 0

Doesn't work on article page/1st page.
But works fine on question forums.

Any replacement for that on XF 2.2?
 
This is a fantastic resource, thanks so much!

That said, I'm trying the before, middle, end for Unregistered users and it's not showing up for me.

Combined: After First, Middle and Before Last Post

I'm only getting it in the "after first post" slot. XF2.2
 
Hi, @parafly9 instead of adsense, try entering some plain text and see if it activates.

99 percent of the time it is an adsense detection problem. The guides listed here work on the safe side (except for forums that contain articles)
 
Top Bottom