alfanexus Posted November 25, 2015 Share 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? Link to comment Share on other sites More sharing options...
Marius Posted November 25, 2015 Share Posted November 25, 2015 I'm interested too. Link to comment Share on other sites More sharing options...
Day_ Posted November 25, 2015 Share 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 Link to comment Share on other sites More sharing options...
Marius Posted November 25, 2015 Share Posted November 25, 2015 For use custom locations, that means we modify templates? And we must redo after each upgrade? Link to comment Share on other sites More sharing options...
Day_ Posted November 25, 2015 Share 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. Link to comment Share on other sites More sharing options...
Tripp★ Posted November 25, 2015 Share 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. Link to comment Share on other sites More sharing options...
alfanexus Posted November 25, 2015 Author Share Posted November 25, 2015 Okay thanks, I think I will go this way also then Link to comment Share on other sites More sharing options...
alfanexus Posted November 29, 2015 Author Share 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. Link to comment Share on other sites More sharing options...
Day_ Posted November 29, 2015 Share Posted November 29, 2015 Will this show on login pages? As they are also against Adsense t&c's Link to comment Share on other sites More sharing options...
alfanexus Posted November 30, 2015 Author Share 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. Link to comment Share on other sites More sharing options...
Day_ Posted November 30, 2015 Share 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 Link to comment Share on other sites More sharing options...
alfanexus Posted December 1, 2015 Author Share 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. Link to comment Share on other sites More sharing options...
Day_ Posted December 1, 2015 Share 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 Link to comment Share on other sites More sharing options...
micho Posted February 24, 2016 Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.