Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
AdSense Ad Not Appearing
Avatar
Justin Erickson
Milwaukee
Member
sp_UserOfflineSmall Offline
Jan 23, 2017 - 12:03 pm

I got the ad to show but no white background. It seems that the php code is adding another section under the original.

Ill start fresh.

In each group you have your: Group Name, Description, Select Custom Icon and Special group message to be displayed above forums.

I use the special group message to display my ads. When adding anything in this field it gives a white background so you can read the text. I will add text to the special group message for you to see what im talking about. It will say "Here". You will see that it pushes the ad under the section. 

I want the ad to be in this field and not under it.

All im looking for is the adsense ad to work in the special group message.  

Milwaukee Auto Market is a very dynamic community to buy, sell or trade any automotive products.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 23, 2017 - 12:22 pm

Afraid I see no text saying 'here'. As I said before - i DO see an Ad in the white space as in:

Screen-Shot-2017-01-23-at-17.21.42.pngImage Enlarger

which looks like the sort of thing you wanted...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Justin Erickson
Milwaukee
Member
sp_UserOfflineSmall Offline
Jan 23, 2017 - 12:37 pm

Hmmm that's weird. Maybe I need to clear my cache. It caches the front page to everyone not logged in. 

I have 4 groups. The first one is what i'm working on. The other 3 already have ads from Amazon and Clickbank. They all work in the special message field. The adsense code will not work in the special message field. 

Here is a screenshot on what i'm talking about incase clearing the cache doesn't work. And if it doesn't work, then I have more problems then I thought. 

MKESCREENSHOT.pngImage Enlarger

Milwaukee Auto Market is a very dynamic community to buy, sell or trade any automotive products.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 23, 2017 - 1:16 pm

Well - when I reloaded the page I finally saw the 'here' but I don't see that ad you just posted. The one I posted is the only one I see - correctly showing in the 'white' area.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Justin Erickson
Milwaukee
Member
sp_UserOfflineSmall Offline
Jan 23, 2017 - 2:13 pm

The ad you showed is just a picture with a link to a clickbank product.

The other 2 are amazon ad codes.

The one I showed is adsense. 

I just looked at it in mobile view on a different IP. The adsense ad doesn't show at all. But the amazon ads do. I also have an adsense ad in the footer that did show. 

I cleared all cache and browser with the same result. 

So now I have 2 problems. I can't get the adsense ad to show in the box. And why are coded ads not showing up for people in the special message box?

I have amazon coded ads all over with articles that display fine. 

I'm thinking there is something with the special message section that's not allowing the code to display properly or at all. All my ad codes work outside the forums.  

Milwaukee Auto Market is a very dynamic community to buy, sell or trade any automotive products.

Avatar
Justin Erickson
Milwaukee
Member
sp_UserOfflineSmall Offline
Jan 23, 2017 - 2:27 pm

Here is the code I used in the functions.php to show the adsense ad in that screenshot. Maybe there is something missing?

I did just look at it on another IP and the amazon ads do show but not the adsense. Not to sure what I should do about this. Seems there is a bit of work on hand to get coded ads to work properly in the special message section. 

add_filter('sph_GroupHeaderMessage', 'my_header');
function my_header($out) {
global $spThisGroup;
if ($spThisGroup->group_id == 2) {
# add adsense to $out here
$out.= '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Milwaukee Auto Auctions -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-8679649126112925"
data-ad-slot="1353012698"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>';
}
return $out;
}
?>

Milwaukee Auto Market is a very dynamic community to buy, sell or trade any automotive products.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 24, 2017 - 12:47 am

So I too am seeing adsense ads on your forum group view... pretty much the code you showed here...  plus the 'here'...  was that ad output another way?

this code definitely works - just tested it and your ad shows...

add_filter('sph_GroupHeaderMessage', 'my_header');
function my_header($out) {
    global $spThisGroup;
    if ($spThisGroup->group_id == 2) {
        # add adsense to $out here
        $out.= '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
            <!– Milwaukee Auto Auctions –>
            <ins class="adsbygoogle"
            style="display:inline-block;width:728px;height:90px"
            data-ad-client="ca-pub-8679649126112925"
            data-ad-slot="1353012698"></ins>
            <script>
            (adsbygoogle = window.adsbygoogle || []).push({});
            </script>';
    }
    return $out;
}

important.. your code (at least as pasted above) has some invalid quote characters...  please try copying the code above using the raw code button and then copying (dont just copy text from the forum display) to ensure you get proper quotes...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 617
Members: 17359
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10125
Posts: 79620