Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted November 25, 20159 yr 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?
November 25, 20159 yr 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
November 25, 20159 yr For use custom locations, that means we modify templates? And we must redo after each upgrade?
November 25, 20159 yr 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.
November 25, 20159 yr 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.
November 29, 20159 yr Author 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.
November 30, 20159 yr Author 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.
November 30, 20159 yr 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
December 1, 20159 yr Author 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.
December 1, 20159 yr Oh, I thought you had to give Google a login if they were behind login protected pages and wasn't a choice
February 24, 20169 yr 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
Archived
This topic is now archived and is closed to further replies.