MikeJones

In my forum ... it shows the ads only 1 time.

Let's take an example for the understanding - You are at the homepage of a forum and the ad should be visible under the header and under the tags (It barely shows header and footer ads on desktop... On mobile, it's better than the desktop). But it shows the ads only 1 or 2 times after that if we want to view the ads again we have to reload the page.

And Now assume you opened a discussion and the ads should be after every 5 posts.
So the problem with AdSense that it doesn't show any ads and it shows ads after refreshing the page 1-2 times and the same on mobile.

And the second problem is that ... it shows the ads only 1 time 😅. I mean if you go back from that discussion and opened another one so it will not show any ad anywhere(header + under the tags+ between the posts) . We have to again reload the page 1-2 times to see the ads again. (Same with the mobile but better than desktop)

I have tried simple banner test ads from some other networks .. they worked. It showed ads every ad and every time without any reload
But then I tried google test ads from here - https://developers.google.com/publisher-tag/samples/display-test-ad ... It didn't work for me. It just makes space and sometimes it will show an ad.

Maybe Adsense has some problem with SPA ?

11 days later

Is it possible to add the word "Advertisement" On top of each ad?

    Braden

    Like this ??

    <center>


    <center><div><h6>ADVERTISEMENT</h6></div>
    
    Your Ad code
      
    </center>

    Please, someone Review this is correct or not

      xasharma Good try! But if i place that before <script> it displays at the bottom

      It would have been nice if its at the top maybe inside ad div

        Braden

        For mobile -

        I also tried on google ads ... its working for me

        are you using auto ad code ??

          Braden

          Use display ad units ... these are better

          And use your ad auto ad code by installing an extension named HTML Head tags

          (You can also type your Adsense ID by Enabling in Flarum/ads but on 19th July google launched a new code so use the ad auto ad code in HTML head tag extension for better improvement because Flarum/ads use an older one which is also good but there is a mix of old and new code)

          you can read this article by google for more info - https://support.google.com/adsense/answer/10627874?hl=en

          How to use ad units?

          Go to your Adsense account and click on ads.

          Then choose by unit ads

          Personally, I use display ads for the whole site (you can try different if you want)

          Click on display ads and they will you a code snippet (ad code) and then use that ad code for between the posts under and for header + under tags)

          Your ad code will look like this -

          <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5941506786539927"
               crossorigin="anonymous"></script>
          <!-- Custom center footer -->
          <ins class="adsbygoogle"
               style="display:block"
               data-ad-client="ca-pub-xxxxxxxxxxx"
               data-ad-slot="xxxxxxxxxxxxx"
               data-ad-format="auto"
               data-full-width-responsive="true"></ins>
          <script>
               (adsbygoogle = window.adsbygoogle || []).push({});
          </script>

          For Header use this code -

          <center><div><h6>ADVERTISEMENT</h6></div>
          
          Your Display ad unit code
            
          </center>

          For between the posts use this one -

          <center><div><h6>ADVERTISEMENT</h6></div></center>
          
          Your Display ad unit code

          For under the tags -

          <center><div><h6>ADVERTISEMENT</h6></div></center>
          
          Your Display ad unit code

            xasharma I now know why i was getting this problem

            You see these google codes, they can display "Advertisement" word automatic , its there, but its not shown on code. It can display automatic when the code is align at center in DIV ✔️

            i forgot to mention, with a css

            .google-auto-placed::before { 
            content: "Advertisements";
            }
            6 days later

            Since this extension asks for the Adesnse pub-xxxxxxxxxxxxxxxx

            Should I take it out of my ad code for them to display?

            I have this for under the header add and its not showing up

            <div align="center">
            <style type="text/css">
            .adslot_1 { width: 320px; height: 100px; }
            @media (min-width:500px) { .adslot_1 { width: 468px; height: 100px; } }
            @media (min-width:800px) { .adslot_1 { width: 728px; height: 100px; } }
            </style>
            <ins class="adsbygoogle adslot_1"
                style="display:inline-block;"
                data-ad-client="ca-pub-xxxxxxxxx"
                data-ad-slot="xxxxxxxx"
            ></ins>
            </div>

            shoudl I remove the data-ad-client="ca-pub-xxxxxxxxx" line?

            Update, I tried removing that line and it didnt work. Not sure how to get the Adsense ads to show up here.

              • [deleted]

              Seeing this thread just reminds me of how much I despise ads. I understand the origin (to generate revenue) but I refuse to have ads on any of my sites as I feel it detracts the user experience.

                xasharma So I tried your format for ads with this extension:

                <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5941506786539927"
                     crossorigin="anonymous"></script>
                <!-- Custom center footer -->
                <ins class="adsbygoogle"
                     style="display:block"
                     data-ad-client="ca-pub-xxxxxxxxxxx"
                     data-ad-slot="xxxxxxxxxxxxx"
                     data-ad-format="auto"
                     data-full-width-responsive="true"></ins>
                <script>
                     (adsbygoogle = window.adsbygoogle || []).push({});
                </script>

                I placed that in all the ad blocks. I only see ads in between posts but not at the top or the sidebar? Any ideas?

                  [deleted] Seeing this thread just reminds me of how much I despise ads. I understand the origin (to generate revenue) but I refuse to have ads on any of my sites as I feel it detracts the user experience.

                  Agreed but if you make the ads simple an no pop ups I take that as a middle ground. Not everyone is fortunate enough to run a site all on their own income. There are other ways to make income on a site which I am doing but, its not enough to cover all the server costs at this time. Before I upgraded to 1.0 I almost have all my server costs covered from amazon affiliates and adsense combined. Eventually if affiliates can cover both I could remove ads in the future.

                  Maybe this needs to be split off to a new post admins lol

                    MikeJones all my server costs covered from amazon affiliate

                    Have any extension to working in Flarum with Amazon Affiliates?

                      MikeJones

                      This is an extension error .....It doesn't work with header and under tags ads (And the ads that you sometimes see at these places are placed by google auto ads, not by extension ... For now, extension is working good for between the post ads)

                      I use header code in admin > appearance >customer header (It works for every time) ..... same for footer ( and also use <center> ...... </center> for both) ... But it not looks that good ... so maximum time I remove it and sometimes insert it (when I promote the site by ads)

                        And the extension is only not working for google ads .... I tried some custom banner ads which are working great >

                        Walys I am not using an extension for my Amazon Affiliate. I just strategically recommend things based on the articles on my site within posts.

                        xasharma bummer...

                        I submitted a bug report to @malago on GitHub. Hoping I can help beta test if he wants to try anything.

                        [deleted]

                        My forum is related to programming and cybersecurity courses and tools ... so I have to upload TB's of data and provide it for free to users. And cloud-like mega, Dropbox are little bit expensive and ads are the only way .......

                          So what's the best way to do a bounty on this?

                          I am willing to fork over $60 if someone can get adsense ads working in all the spots and not just in-between posts.

                          Edit: payment would be over PayPal