Join the community today
Register Now

Nginx PageSpeed ngx_pagespeed advertising conflicts ?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by eva2000, Jun 2, 2014.

  1. eva2000

    eva2000 Administrator Staff Member

    28,348
    6,438
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,533
    Local Time:
    4:44 PM
    Nginx 1.13.x
    MariaDB 5.5
    Last edited: Jun 9, 2014
  2. BamaStangGuy

    BamaStangGuy Active Member

    465
    136
    43
    May 25, 2014
    Ratings:
    +179
    Local Time:
    1:44 AM
    I am only using Google Adsense at the moment. I have found the same as @RoldanLT in that I will simply get blank ads during some page loads when deferring javascript. This is using pagespeed_no_defer in the script tag as well.
     
  3. RoldanLT

    RoldanLT Well-Known Member

    3,801
    932
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,257
    Local Time:
    2:44 PM
    1.11
    10.2
    Adsense ads content is very random so we cannot filter it 100%.
    I prefer disable defer js of pagespeed and just use the XenForo addon.
    No cut off with my revenue.
     
  4. BamaStangGuy

    BamaStangGuy Active Member

    465
    136
    43
    May 25, 2014
    Ratings:
    +179
    Local Time:
    1:44 AM
    Right now I have set my size limit on combining javascript to 840000 so that all javascript is combined together and I am only loading one javascript file inside <head> Good enough for me.
     
  5. RoldanLT

    RoldanLT Well-Known Member

    3,801
    932
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,257
    Local Time:
    2:44 PM
    1.11
    10.2
    How ? :)
     
  6. BamaStangGuy

    BamaStangGuy Active Member

    465
    136
    43
    May 25, 2014
    Ratings:
    +179
    Local Time:
    1:44 AM
    pagespeed MaxCombinedJsBytes 840000;
     
    • Like Like x 2
  7. eva2000

    eva2000 Administrator Staff Member

    28,348
    6,438
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,533
    Local Time:
    4:44 PM
    Nginx 1.13.x
    MariaDB 5.5
    You'd want to be careful with combining all js as such.. the large js file download time might override any benefit of combining js on slower connections.

    Was going to mention pagespeed_no_defer attribute https://developers.google.com/speed/pagespeed/module/filter-js-defer to exclude the javascript. Shame to see it not work for you Brent.
     
  8. BamaStangGuy

    BamaStangGuy Active Member

    465
    136
    43
    May 25, 2014
    Ratings:
    +179
    Local Time:
    1:44 AM
    It also breaks html 5 specifications when you use pagespeed_no_defer=""
     
  9. eva2000

    eva2000 Administrator Staff Member

    28,348
    6,438
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,533
    Local Time:
    4:44 PM
    Nginx 1.13.x
    MariaDB 5.5
    interesting problem as sort of defeats the purpose of pagespeed
     
  10. BamaStangGuy

    BamaStangGuy Active Member

    465
    136
    43
    May 25, 2014
    Ratings:
    +179
    Local Time:
    1:44 AM
    Here is why it breaks adsense:

    Screen Shot 2014-06-02 at 9.26.47 AM.png
     
    • Like Like x 1
  11. eva2000

    eva2000 Administrator Staff Member

    28,348
    6,438
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,533
    Local Time:
    4:44 PM
    Nginx 1.13.x
    MariaDB 5.5
  12. BamaStangGuy

    BamaStangGuy Active Member

    465
    136
    43
    May 25, 2014
    Ratings:
    +179
    Local Time:
    1:44 AM
    That is a separate issue from the adsense is it not? I have ran it with and without jquery excluded and still have seen the adsense issue. I just didn't add the jquery disallow back for the quick test this time.
     
  13. eva2000

    eva2000 Administrator Staff Member

    28,348
    6,438
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,533
    Local Time:
    4:44 PM
    Nginx 1.13.x
    MariaDB 5.5
    ah yes separate issue :)
     
  14. BamaStangGuy

    BamaStangGuy Active Member

    465
    136
    43
    May 25, 2014
    Ratings:
    +179
    Local Time:
    1:44 AM
    With your rules added back:

    Screen Shot 2014-06-02 at 9.33.51 AM.png

    Screen Shot 2014-06-02 at 9.34.44 AM.png
     
    • Like Like x 1
  15. eva2000

    eva2000 Administrator Staff Member

    28,348
    6,438
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,533
    Local Time:
    4:44 PM
    Nginx 1.13.x
    MariaDB 5.5
    Okay for testing ngx_pagespeed with Google Adsense, I am testing serving 728x90 ads after the first post. It looks to be serving up fine here for me. What about you guys ?

    Code:
    [Tue, 03 Jun 2014 02:15:40 GMT] [Info] [6637] No permission to rewrite 'http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js'
    pagespeed message log correctly ignores the Adsense code
     
    • Like Like x 1
  16. BamaStangGuy

    BamaStangGuy Active Member

    465
    136
    43
    May 25, 2014
    Ratings:
    +179
    Local Time:
    1:44 AM
    Are you using async responsive? It also seems to happen with three ads on a page. The last ad on the page is the one that does not load.
     
  17. eva2000

    eva2000 Administrator Staff Member

    28,348
    6,438
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,533
    Local Time:
    4:44 PM
    Nginx 1.13.x
    MariaDB 5.5
    yeah using async - the default code adsense spits out for me to use
     
  18. eva2000

    eva2000 Administrator Staff Member

    28,348
    6,438
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,533
    Local Time:
    4:44 PM
    Nginx 1.13.x
    MariaDB 5.5
    might have found your problem as you got complaints console about adsbygoogle already having ads https://support.google.com/adsense/answer/3221666?hl=en

    so you can probably insert the adsbygoogle.js once in your header or footer templates and just include the rest for each instance ?

    I put the adsbygoogle.js in my PAGE_CONTAINER template

    HTML:
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    </head>
     
    Last edited: Jun 4, 2014
  19. RoldanLT

    RoldanLT Well-Known Member

    3,801
    932
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,257
    Local Time:
    2:44 PM
    1.11
    10.2
    default async and async responsive is different :)
     
  20. eva2000

    eva2000 Administrator Staff Member

    28,348
    6,438
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,533
    Local Time:
    4:44 PM
    Nginx 1.13.x
    MariaDB 5.5
    there's only 2 options available to me async or sync when i get my code though