Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
BradTBP Posted September 22, 2022 Posted September 22, 2022 Or how to exclude member group (s). I saw the thread that discussed this with Adsense Auto Ads from about three years ago. I think both adsense and invision have since changed. The instruction did not work for me. I have a member group that pays to have no ads and cannot figure out how to exclude a member group. If anyone is currently using Auto Ads on Adsense and has success controlling which member groups are subject to auto ads and which one see just the ads I place, please share. My revenue was higher with auto ads, so I would like to find a way to use without fouling up member groups. Thank you.
Randy Calvert Posted September 22, 2022 Posted September 22, 2022 (edited) This is not something you can check on/off in the core platform, but it's a relatively simple template edit. In the global template, you can do something like: {{if \IPS\Member::loggedIn()->member_group_id === 4}} SOME CODE HERE THAT WOULD ONLY SHOW TO ADMINS {{endif}} If you wanted to show some code to a bunch of different member groups... {{if in_array( \IPS\Member::loggedIn()->member_group_id, array( 5, 10, 11 ) )}} SOME CODE HERE THAT WOULD ONLY SHOW TO SPECIFIED GROUPS {{endif}} Edited September 22, 2022 by Randy Calvert SeNioR- 1
Jim M Posted September 22, 2022 Posted September 22, 2022 Auto ads from Adsense is not recommended as it will inject ads in odd places. Customizations, like what Randy provided, are outside our scope of support. You may wish to read more about our advertising module here:
rastafari Posted September 25, 2022 Posted September 25, 2022 On 9/22/2022 at 10:43 PM, Randy Calvert said: This is not something you can check on/off in the core platform, but it's a relatively simple template edit. In the global template, you can do something like: {{if \IPS\Member::loggedIn()->member_group_id === 4}} SOME CODE HERE THAT WOULD ONLY SHOW TO ADMINS {{endif}} If you wanted to show some code to a bunch of different member groups... {{if in_array( \IPS\Member::loggedIn()->member_group_id, array( 5, 10, 11 ) )}} SOME CODE HERE THAT WOULD ONLY SHOW TO SPECIFIED GROUPS {{endif}} Unfortunately it didn't work for auto ads .
Randy Calvert Posted September 25, 2022 Posted September 25, 2022 Sure it does. I use the version of it to only show ads to guests. This code goes in your theme within the global template in the head section. It does not go in the standard IPB ad code area. tnn 1
rastafari Posted September 25, 2022 Posted September 25, 2022 (edited) It is there since Friday and i m trying to do the same thing as you, for guests. edit Also i cannot figure out why auto ads they also appear in themes where the code has not been passed Edited September 25, 2022 by rastafari
Randy Calvert Posted September 25, 2022 Posted September 25, 2022 If you are only doing it for guests... it's even easier. You don't need to check group. Just check if logged in. {{if \IPS\Member::loggedIn()->member_id === NULL}} <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-XXXXXXX" crossorigin="anonymous"></script> {{endif}} Smack that right before your end head code. Regarding appearing in other themes, make sure you don't have any ad code stuck somewhere in the IPB ad area that Jim linked to above. You cannot use the auto ads there... it MUST be in the global template otherwise it will not get added to the header and instead just stuck in wherever is setup within the body. SeNioR- and tnn 1 1
rastafari Posted September 25, 2022 Posted September 25, 2022 (edited) Unfortunately, it doesn't work that way either. There is nothing about auto ads in ipb advertising area except some fixed google ads. I`m on 4.6.12.1 if that say anything but i don`t think so. Edited September 25, 2022 by rastafari
Randy Calvert Posted September 25, 2022 Posted September 25, 2022 Try turning those off... because they may be causing problems. Also don't just look for the ad to be displaying. Actually right click and view source. Look at the code to make sure it's injecting to the right group. Google does not always decide to return ads for every site on every request. The only way to confirm it's actually "working" is to check for the code. If the code is there, then it's a Google problem of them deciding not to show the ad. tnn 1
Marc Posted September 26, 2022 Posted September 26, 2022 You could also add some random text at the top to ensure its inserting things as required
rastafari Posted September 26, 2022 Posted September 26, 2022 3 hours ago, Marc Stridgen said: You could also add some random text at the top to ensure its inserting things as required it works as it should and appears correctly on page source. 17 hours ago, Randy Calvert said: Try turning those off... because they may be causing problems and finally that`s the problem. The first part of fixed ads is exactly the same code as auto ads .
Marc Posted September 26, 2022 Posted September 26, 2022 Glad to hear you found a resolution to the issue 🙂
BradTBP Posted September 26, 2022 Author Posted September 26, 2022 22 hours ago, rastafari said: Also i cannot figure out why auto ads they also appear in themes where the code has not been passed I have seen the same thing and it wrecks my paid subscribers!
Randy Calvert Posted September 26, 2022 Posted September 26, 2022 5 minutes ago, BradTBP said: I have seen the same thing and it wrecks my paid subscribers! If you're using the Adsense auto ad code within the IPS advertising system, it will NOT work. Disable all ads in the advertising manager and use the template logic system. The code that I used above does work. The person you were quoting was using the auto ad code within the IPS advertising system, which puts the ad code in the wrong spot (within the body instead of the head). This will cause very unstable results. rastafari and tnn 1 1
BradTBP Posted September 26, 2022 Author Posted September 26, 2022 I did not put the auto ads in the IPS advertising system, I put it in my template between head tags. However, I still put in individual ad code in the IPS advertising system to ensure ads in certain places. I will try it on a clean template with no IPS system ads at all. I appreciate all the dialogue on this thread. Thanks. Hopefully, I can come back and tell you I'm in good shape!
Marc Posted September 27, 2022 Posted September 27, 2022 Note if you have selected auto ads in google ads, then thats what we are referring to here. If you have selected the wrong type it will break even if you are adding it in the correct place in our ad system
rastafari Posted September 27, 2022 Posted September 27, 2022 In other words if you want to work the above code with auto ads do not place fixed ads anywhere in your community. The only way I found that seems to work properly is to exclude a page from auto ads and on this page in your community to add custom blocks with fixed ads. This way the above code works correclty. With ips internal advertisements when you check a specific location to show the advertisement(e.g. Just above the page footer) is there a way to exclude specific pages? ?
Marc Posted September 27, 2022 Posted September 27, 2022 There is no way in which to exclude specific pages, unless you specifically add code for that rastafari 1
rastafari Posted September 27, 2022 Posted September 27, 2022 On 2/6/2019 at 7:29 AM, newbie LAC said: Hello, Show ad {{if (\mb_strpos($_SERVER['REQUEST_URI'], 'test') !== false)}} 1 {{endif}} Hide ad {{if !(\mb_strpos($_SERVER['REQUEST_URI'], 'test') !== false)}} 1 {{endif}} The above seems to work fine if it placed in extra condition tab but i`m not pretty sure that is exactly right
VaBeach_Guy Posted July 14, 2023 Posted July 14, 2023 Do auto ads actually increase revenue? In other words, is it worth going through the hassle of trying to exclude member groups?
Marc Posted July 17, 2023 Posted July 17, 2023 On 7/14/2023 at 7:35 PM, VaBeach_Guy said: Do auto ads actually increase revenue? In other words, is it worth going through the hassle of trying to exclude member groups? Im not sure one relates to the other. You can have auto ads and still exclude usergroups
VaBeach_Guy Posted September 3, 2023 Posted September 3, 2023 On 7/17/2023 at 2:49 AM, Marc Stridgen said: Im not sure one relates to the other. You can have auto ads and still exclude usergroups In the past when I tried auto ads, it displayed for everyone even thought I had members excluded. I want to exclude members for a couple of reasons. One, as a benefit of membership, they see no ads. Two, members tend to want to 'help' the board earn money by click, click, clicking as many ads as possible, and that will cause Google to eliminate our ability to have ads.
Marc Posted September 4, 2023 Posted September 4, 2023 I would need an example of this not working on your site in order to advise. If you havent selected for them to see ads within our ad system, they shouldnt be seeing them at all.
VaBeach_Guy Posted September 16, 2023 Posted September 16, 2023 On 9/4/2023 at 4:48 AM, Marc Stridgen said: I would need an example of this not working on your site in order to advise. If you havent selected for them to see ads within our ad system, they shouldnt be seeing them at all. I can't swear that it was after my upgrade a few months ago or before. I'll run a test and see what happens.
Recommended Posts