Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
LDDG Posted April 24, 2017 Posted April 24, 2017 This is something that has always bugged me and I thought I was the only one suffering this. I really appreciate you guys coming out and getting this addressed. I have made the changes to custom.css using this as posted by @gavpedz: /* GOOGLE AD CODE FOR RESPONSIVE ADS */ #ipsLayout_mainArea .adsbygoogle { width: 300px; height: 250px; } @media (min-width:380px) { #ipsLayout_mainArea .adsbygoogle { width: 336px; height: 280px; } } @media (min-width:764px) { #ipsLayout_mainArea .adsbygoogle { width: 728px; height: 90px; } } @media (min-width:980px) { #ipsLayout_mainArea .adsbygoogle { width: 468px; height: 60px; } } @media (min-width:1160px) { #ipsLayout_mainArea .adsbygoogle { width: 728px; height: 90px; } } #ipsLayout_sidebar .adsbygoogle { width: 300px; height: 250px; } @media (min-width:380px) { #ipsLayout_sidebar .adsbygoogle { width: 336px; height: 280px; } } @media (min-width:980px) { #ipsLayout_sidebar .adsbygoogle { width: 300px; height: 600px; } } but on mobile mode, the header banner still appears too small. The sidebar and footer ads show up as a nice big square ad, but the header ad stil shows up as a small leaderboard banner. All 3 ads have been setup as responsive ads in Google. Can anyone check it out using their iPhone or Android phone? www.losdurosdelgenero.com The very first ad shows up too small, but if you scroll down, the 2nd and 3rd ads show up as big squares. This is how the ads are showing up:
gavpedz Posted April 24, 2017 Author Posted April 24, 2017 Yes I have been having that issue as well. I am guessing there is some other code or something that restricts that area but don't know. Oddly while testing in different viewport sizes in my browser to get the best fit ad sizes I did notice the header one show a taller ad once. So not sure if it will again or if it was just a one off. For me I am not to bothered for the moment as I am still testing IPS and have not done my final conversion yet. It is odd though seeing as none of the ad sizes in that code are small banners. Anyone able to shed any light on that?
LDDG Posted April 24, 2017 Posted April 24, 2017 10 minutes ago, gavpedz said: Yes I have been having that issue as well. I am guessing there is some other code or something that restricts that area but don't know. Oddly while testing in different viewport sizes in my browser to get the best fit ad sizes I did notice the header one show a taller ad once. So not sure if it will again or if it was just a one off. For me I am not to bothered for the moment as I am still testing IPS and have not done my final conversion yet. It is odd though seeing as none of the ad sizes in that code are small banners. Anyone able to shed any light on that? Oh ok, at least now I know it's just not my setup. I have a feeling there might be some code somewhere that's affecting the #ipsLayout_mainArea ads, which is where the header ad code located.
Day_ Posted April 24, 2017 Posted April 24, 2017 @LDDG I have the same issue as you, having took a look at your site you have ads on the login page, I'm guessing you are using the default header placement in settings. It's actually against Google policy to have them on login pages so be careful https://support.google.com/adsense/answer/1346295?hl=en-GB#Ads_on_non_content_pages I manually placed a custom location key at the top and bottom of these templates for header and footer ads, that covers the main pages on the site forums > front > forums > forumDisplay forums > front > index > index forums > front > topics > topic
gavpedz Posted April 24, 2017 Author Posted April 24, 2017 im sure i saw a setting somewhere in the acp to not show ads on login and error pages. Did i imagine that?
gavpedz Posted April 24, 2017 Author Posted April 24, 2017 Ah ok so it's google then really that's limiting the header ad height.
Day_ Posted April 24, 2017 Posted April 24, 2017 7 minutes ago, gavpedz said: Ah ok so it's google then really that's limiting the header ad height. https://support.google.com/adsense/answer/1346295?hl=en-GB#Difficult_to_distinguish_ads_and_content
gavpedz Posted April 26, 2017 Author Posted April 26, 2017 Is there a way to not show ads in certain forums? I have a couple of member only forums (they have to be logged in to see it) and obviously google doesn't allow you to show ads in hidden areas so was wondering how i can stop ads showing in certain forums.
Day_ Posted April 26, 2017 Posted April 26, 2017 2 minutes ago, gavpedz said: Is there a way to not show ads in certain forums? I have a couple of member only forums (they have to be logged in to see it) and obviously google doesn't allow you to show ads in hidden areas so was wondering how i can stop ads showing in certain forums. I'm using custom location keys and have mine setup like this. Where you see array ( 9 ) in each section, replace with the forum id's you want to hide, should be the number inside each boards URL. Topic Page forums > front > topics > topic (use at the top of the template for the header, bottom for footer) {{if \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'topic'}} {{$forumId = 0; try { $topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id ); $forumId = $topic->forum_id; } catch( \Exception $e ) {};}} {{endif}} {{if !in_array($forumId, array(9))}} {advertisement="ADVERTKEY"} {{endif}} Around row 253 in the same template, this is after the first post. The middle 3 lines should already be there, just add the top if array line and closing end if. Quick tip if you want to change the number of posts before the advert shows, just change the number in $postCount == 1 I have 10 posts per page so set this to 5, that way with the header, this ad and footer you have the full page pretty much covered and doesn't look spammy when a topic only has like 2 posts in. {{if !in_array($forumId, array(9))}} {{if $postCount == 1 AND $advertisement = \IPS\core\Advertisement::loadByLocation( 'ad_topic_view' )}} {$advertisement|raw} {{endif}} {{endif}} Forum Display forums > forums > forumDisplay (use at the top of the template for the header, bottom for footer) {{if ( \IPS\Request::i()->controller == 'forums' AND isset( \IPS\Request::i()->id ) AND ! in_array( \IPS\Request::i()->id, array( 9 ) ) ) }} {advertisement="ADVERTKEY"} {{endif}} forums > forums > topicRow on row 10 (this is for the ad after the first topic in forum listing). Same as the topic page, you're just adding the first line and closing end if. Also if you want to change the number of topics before the advert shows change this number $rowCount == 1 again just like above, I have 20 topics per page so set this to 10 {{if ( \IPS\Request::i()->controller == 'forums' AND isset( \IPS\Request::i()->id ) AND ! in_array( \IPS\Request::i()->id, array( 9 ) ) ) }} {{if $rowCount == 1 AND $advertisement = \IPS\core\Advertisement::loadByLocation( 'ad_forum_listing' )}} <li class="ipsDataItem"> {$advertisement|raw} </li> {{endif}} {{endif}}
gavpedz Posted April 26, 2017 Author Posted April 26, 2017 1 minute ago, daveoh said: I'm using custom location keys and have mine setup like this. Where you see array ( 9 ) in each section, replace with the forum id's you want to hide, should be the number inside each boards URL. Topic Page forums > front > topics > topic (use at the top of the template for the header, bottom for footer) {{if \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'topic'}} {{$forumId = 0; try { $topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id ); $forumId = $topic->forum_id; } catch( \Exception $e ) {};}} {{endif}} {{if !in_array($forumId, array(9))}} {advertisement="ADVERTKEY"} {{endif}} Around row 253 in the same template, this is after the first post. The middle 3 lines should already be there, just add the top if array line and closing end if. Quick tip if you want to change the number of posts before the advert shows, just change the number in $postCount == 1 I have 10 posts per page so set this to 5, that way with the header, this ad and footer you have the full page pretty much covered and doesn't look spammy when a topic only has like 2 posts in. {{if !in_array($forumId, array(9))}} {{if $postCount == 1 AND $advertisement = \IPS\core\Advertisement::loadByLocation( 'ad_topic_view' )}} {$advertisement|raw} {{endif}} {{endif}} Forum Display forums > forums > forumDisplay (use at the top of the template for the header, bottom for footer) {{if ( \IPS\Request::i()->controller == 'forums' AND isset( \IPS\Request::i()->id ) AND ! in_array( \IPS\Request::i()->id, array( 9 ) ) ) }} {advertisement="ADVERTKEY"} {{endif}} forums > forums > topicRow on row 10 (this is for the ad after the first topic in forum listing). Same as the topic page, you're just adding the first line and closing end if. Also if you want to change the number of topics before the advert shows change this number $rowCount == 1 again just like above, I have 20 topics per page so set this to 10 {{if ( \IPS\Request::i()->controller == 'forums' AND isset( \IPS\Request::i()->id ) AND ! in_array( \IPS\Request::i()->id, array( 9 ) ) ) }} {{if $rowCount == 1 AND $advertisement = \IPS\core\Advertisement::loadByLocation( 'ad_forum_listing' )}} <li class="ipsDataItem"> {$advertisement|raw} </li> {{endif}} {{endif}} Thanks for that, really helpful. I wonder what happens when ips has an update do template edits get overwritten?
Day_ Posted April 26, 2017 Posted April 26, 2017 2 minutes ago, gavpedz said: Thanks for that, really helpful. I wonder what happens when ips has an update do template edits get overwritten? When you update as far as I'm aware no templates are overwritten you have to manually update them. I use pretty much the stock theme with minor adjustments like this so I create a new theme after each update, open the old theme in a separate tab, uncheck unmodified then copy all my changes across. Forgot to say if you are using a custom theme the row numbers above might be different. Also forgot to add, if you have longer pages and say wanted to run an advert after the 5th and 10th post or 10th and 20th topic you can use $postCount == 3 OR $postCount == 7 $postCount == 5 OR $postCount == 10 and $rowCount == 10 OR $rowCount == 20
gavpedz Posted April 26, 2017 Author Posted April 26, 2017 Great thanks so much. What about error pages am i right in thinking google doesn't like ads to be displayed on error pages? When i do my final conversion i will be looking to keep things pretty close to default as well Spent many years customising xenforo and in the end just leads to a lot of headaches and work so am going to try and keep things a bit simpler this time.
Day_ Posted April 26, 2017 Posted April 26, 2017 1 minute ago, gavpedz said: Great thanks so much. What about error pages am i right in thinking google doesn't like ads to be displayed on error pages? When i do my final conversion i will be looking to keep things pretty close to default as well Spent many years customising xenforo and in the end just leads to a lot of headaches and work so am going to try and keep things a bit simpler this time. That's right, these won't show on error pages, just the forum and topic pages. For the home page add a custom location key to the index template. Pretty much covers the main places you want adverts.
gavpedz Posted April 26, 2017 Author Posted April 26, 2017 Just now, daveoh said: That's right, these won't show on error pages, just the forum and topic pages. For the home page add a custom location key to the index template. Pretty much covers the main places you want adverts. Thanks will this also show in the gallery, downloads, pms etc or will that be in other templates?
Day_ Posted April 26, 2017 Posted April 26, 2017 Just now, gavpedz said: Thanks will this also show in the gallery, downloads, pms etc or will that be in other templates? No you'll need to add them into those templates separately
gavpedz Posted April 26, 2017 Author Posted April 26, 2017 Hmm ok so there is not an alternative to this in doing some kind of if array to not show on login and error pages rather than having to edit all these templates?
MeMaBlue Posted April 26, 2017 Posted April 26, 2017 if anybody can comment on the revenue difference after making those changes, it would be great. SUPER @gavpedz @sound that you mentioned this subject, i was also trying to figure out why this was like that, and actually just put 300x250 everywhere untill i solve the issue. !
gavpedz Posted April 26, 2017 Author Posted April 26, 2017 I don't have any revenue change I'm afraid as my forum is actually on xenforo and running ads as I want. I have been running a test conversion which is when I noticed this on IPS so now that I have figured this out I am almost ready to make the final conversion.
Day_ Posted April 27, 2017 Posted April 27, 2017 I've been experimenting, after removing the css from global.css and letting Google decide the size of ads I noticed a small increase, last night I've set the ad sizes to 768x90 banners on desktop/tablet and 320x280 square on mobile whilst leaving the header ad free to do as Google pleases. It's 4pm UK time and I've hit yesterdays total already. No major increase in traffic, a usual steady day. It's too early to say if this down to the ad sizes but now I have the best paid units you would hope to see an increase, will need a full month to compare really. Still struggling to understand why the css was added in the first place
David.. Posted April 27, 2017 Posted April 27, 2017 11 minutes ago, daveoh said: Still struggling to understand why the css was added in the first place Probably because IPB3 people were complaining as to why their non-responsive ads are breaking their community layout.
Day_ Posted April 27, 2017 Posted April 27, 2017 17 minutes ago, David.. said: Probably because IPB3 people were complaining as to why their non-responsive ads are breaking their community layout. Can I sue them for loss of earnings? Bloody moaners, won't catch me moaning grrrrrr
MeMaBlue Posted April 30, 2017 Posted April 30, 2017 On 4/24/2017 at 3:21 PM, gavpedz said: If anyone is interested this is what i have done with mine. (Bear in mind i have the sidebar on pretty much every page possible.) /* GOOGLE AD CODE FOR RESPONSIVE ADS */ #ipsLayout_mainArea .adsbygoogle { width: 300px; height: 250px; } @media (min-width:380px) { #ipsLayout_mainArea .adsbygoogle { width: 336px; height: 280px; } } @media (min-width:764px) { #ipsLayout_mainArea .adsbygoogle { width: 728px; height: 90px; } } @media (min-width:980px) { #ipsLayout_mainArea .adsbygoogle { width: 468px; height: 60px; } } @media (min-width:1160px) { #ipsLayout_mainArea .adsbygoogle { width: 728px; height: 90px; } } #ipsLayout_sidebar .adsbygoogle { width: 300px; height: 250px; } @media (min-width:380px) { #ipsLayout_sidebar .adsbygoogle { width: 336px; height: 280px; } } @media (min-width:980px) { #ipsLayout_sidebar .adsbygoogle { width: 300px; height: 600px; } } Hello! I need some help :-) -why did you put at the 980 media width a 468x60 and not a 728x90 ? - does what is in the curvy brackets mean "show only sizes larger than x by x " / "dont show sizes smaller than " or "show only sizes that are x by x " what version should i use if i want a 970x250 to appear to specific screens? thank you!
gavpedz Posted April 30, 2017 Author Posted April 30, 2017 I did that because as mentioned I thave he sidebar turned on on almost all pages and at certain screen sizes a 728 banner will overlap the sidebar. This might explain the way it works for you. https://support.google.com/adsense/answer/6307124?hl=en-GB
MeMaBlue Posted April 30, 2017 Posted April 30, 2017 well, this means that i could modify the ad code itself, instead of adding code to the custom.css... so, whats the difference... ? that if you modify the adsense code, the forum css will override it ... ? so, no matter what someone modifies inside the adsense code it will probably be useless unless he also /rather changes the custom.css to be in tune with what ze wants . (right? asking to make sure i got it right)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.