Join the community today
Register Now

Google ads formatting

Discussion in 'System Administration' started by SFLC, Jan 23, 2017.

  1. SFLC

    SFLC Active Member

    223
    59
    28
    Dec 4, 2016
    The Canadas
    Ratings:
    +112
    Local Time:
    7:35 AM
    1
    10
    Hello,


    Just wondering how google adsense users maintain the formatting within their html on their sites.

    Google for some reason wants their ad code to remain intact, including new lines and spaces and when I just paste it in my html, it looks like the right formatting, but in the browser it ends up being 1 long concatenated line.

    thanks
     
  2. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    10:35 PM
    Nginx 1.21.x
    MariaDB 10.1.x
    I'm no expert, but do you have any plugins/modules that is minifying code (i.e. removing whitespace, deleting comments, etc.)?
     
    Last edited: Jan 23, 2017
  3. SFLC

    SFLC Active Member

    223
    59
    28
    Dec 4, 2016
    The Canadas
    Ratings:
    +112
    Local Time:
    7:35 AM
    1
    10
    Holy shit, why did I not think of this earlier, you are the man, problem solved!!

    It's been over a month since I contacted google and all i got out of them was, your account is in good standing and your sites are approved, check the ad code and ensure that it's not modified and spacing is intact etc..

    thanks!!
     
  4. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    10:35 PM
    Nginx 1.21.x
    MariaDB 10.1.x
    Glad you got it sorted out; I'm happy to help!
    Other thing I thought of was that very often, new ad placements/modules will appear blank for a few hours. I didn't bring that up because you mentioned an ongoing problem with AdSense on another thread :)
     
  5. SFLC

    SFLC Active Member

    223
    59
    28
    Dec 4, 2016
    The Canadas
    Ratings:
    +112
    Local Time:
    7:35 AM
    1
    10
    Oh ya, adsense has been a pain for me, and they offer virtually no support, I understand they probably have millions of users but they should come up with a better way to deal with things. Earlier I literally suspected everything, including pagespeed which turned out had nothing to do with anything and wasn't altering the code in any way.

    I can't believe i didn't take into consideration from the beginning that the scripts that I use could be injecting the code in a funky way, and based on your advice I just added it manually in the php files and voila, ads appeared!

    thanks again
     
  6. rdan

    rdan Well-Known Member

    5,447
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    1:35 PM
    Mainline
    10.2
  7. SFLC

    SFLC Active Member

    223
    59
    28
    Dec 4, 2016
    The Canadas
    Ratings:
    +112
    Local Time:
    7:35 AM
    1
    10
    Ya, I'm using the responsive layout as well, it's much easier than having to deal with mobile detection and width detection in order to determine what the appropriate ad/size will be. That plus the fact that adsense can be fully https made it the main reason why I did everything I could to get it working. I'm sure some of the bigger players out there also offer https ads but my sites don't get nearly as much traffic as they'd like to see, so there's no point in applying.
     
  8. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    10:35 PM
    Nginx 1.21.x
    MariaDB 10.1.x
    Using another network may not be a terrible option. Although they may get a fraction of the traffic that Google gets, it's important to split test as the other ad networks may have better fill rates or RPM depending on the niche you're in.
     
  9. SFLC

    SFLC Active Member

    223
    59
    28
    Dec 4, 2016
    The Canadas
    Ratings:
    +112
    Local Time:
    7:35 AM
    1
    10
    Makes sense, my old site many years ago used to bring in about $500 per month from adsense, but i had a shitload of daily visitors, that site's long gone so im working on a few new ones, so ill probably stick with adsense for now until the sites get some traction then this will give me more options/flexibility in looking at other ad solutions