Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
alfanexus Posted November 25, 2015 Posted November 25, 2015 Its great that IPS has an inbuild ad-system, but it seems that ads are being displayed on error pages like 404 pages. If you fore example use Google Adsense you will be getting in trouble for putting ads on error pages since its against their TOS. So how can I exclude ads from being displayed on 404 and other error pages?
Day_ Posted November 25, 2015 Posted November 25, 2015 I use custom locations you can setup in the Advertisements setup and not global header or footer, enter them into the index, forum display and topic templates top and bottom
Marius Posted November 25, 2015 Posted November 25, 2015 For use custom locations, that means we modify templates? And we must redo after each upgrade?
Day_ Posted November 25, 2015 Posted November 25, 2015 Depends really, if you're creating a new theme each time them yes, it's only 3 templates so no biggy and adding one at the very top and bottom of the templates takes no time, not like you're digging through the code or anything. If you're using the theme difference pages and making the changes manually/reverting templates they may not be effected. Maybe some if statements you can add to the ad code, be interested if there is but I'm not too fussed if not. Been doing this since 3.4.
Tripp★ Posted November 25, 2015 Posted November 25, 2015 54 minutes ago, daveoh said: I use custom locations you can setup in the Advertisements setup and not global header or footer, enter them into the index, forum display and topic templates top and bottom I did this too but I put the adcode in a Custom Block (Pages) which allows me to put the block anywhere I like.
alfanexus Posted November 25, 2015 Author Posted November 25, 2015 Okay thanks, I think I will go this way also then
alfanexus Posted November 29, 2015 Author Posted November 29, 2015 I have found a solution, so I dont have to edit a lot of templates and still being able to use the predefines location for headder ads. In globalTemplate find: {advertisement="ad_global_header"} and replace with: {{if !in_array('pages', $location )}} {advertisement="ad_global_header"} {{endif}} This way ads a being displayed on all kind of pages except CMS and Error pages. I havent found a way to keep the ads on CMS pages so that only Error pages are excluded. But its the best solution I was able to come up with for now.
Day_ Posted November 29, 2015 Posted November 29, 2015 Will this show on login pages? As they are also against Adsense t&c's
alfanexus Posted November 30, 2015 Author Posted November 30, 2015 Yes I forgot about the login pages. Here is an updated code: {{if !array_intersect(array('pages', 'register', 'login', 'lostpass', 'contact', 'submit'), $location )}} {advertisement="ad_global_header"} {{endif}} I also removed ads on lostpassword, contact form and post submit form. Still haven found a way to include CMS exclude error pages at the same time.
Day_ Posted November 30, 2015 Posted November 30, 2015 2 hours ago, alfanexus said: Yes I forgot about the login pages. Here is an updated code: {{if !array_intersect(array('pages', 'register', 'login', 'lostpass', 'contact', 'submit'), $location )}} {advertisement="ad_global_header"} {{endif}} I also removed ads on lostpassword, contact form and post submit form. Still haven found a way to include CMS exclude error pages at the same time. How do you allow the Adsensebot access to all pages behind a login? To show on profile pages, search etc. you need to setup a login which I've done but it also asks for which URL's are displaying ads on, be impossible to add all user profiles and search url's
alfanexus Posted December 1, 2015 Author Posted December 1, 2015 I havent tried to allow adsensebot to login pages. Ads are being displayed fine anyway, they might be target content on the page but there really is not much content to target on a profilepage anyway. Ads are still target with googles adcookies.
Day_ Posted December 1, 2015 Posted December 1, 2015 Oh, I thought you had to give Google a login if they were behind login protected pages and wasn't a choice
micho Posted February 24, 2016 Posted February 24, 2016 On 30.11.2015 at 2:50 PM, alfanexus said: Yes I forgot about the login pages. Here is an updated code: {{if !array_intersect(array('pages', 'register', 'login', 'lostpass', 'contact', 'submit'), $location )}} {advertisement="ad_global_header"} {{endif}} I also removed ads on lostpassword, contact form and post submit form. Still haven found a way to include CMS exclude error pages at the same time. Not working with new version
Recommended Posts
Archived
This topic is now archived and is closed to further replies.