Adsense cannot be used with Xojo Web

  1. 6 years ago

    Jay M

    28 Jan 2014 Pre-Release Testers, Xojo Pro Austin TX
    Edited 6 years ago

    I am wondering how to embed adsense into a Xojo Web app.

    There is a thread on the old forum that indicates that this is a fools errand.

    Anyone have a brilliant work around?

  2. Greg O

    28 Jan 2014 Xojo Inc

    Do you happen to have a link to the API docs? I can't seem to get to them without signing up for an account.

  3. Rick A

    28 Jan 2014 (Brazil. GMT-3:00)

    You will need a test account anyways, just to check that your experiments works. It costs nothing. :)

    The API's entry page is here: https://developers.google.com/adsense/

    As for an account creation, go here: https://www.google.com/adsense?hl=en&sourceid=aso&subid=ww-en-et-api&medium=et

  4. 2 years ago

    ronaldo f

    18 Dec 2017 Pre-Release Testers, Xojo Pro Philippines

    Anybody had succeeded working with google ad-sense?

    Hoping that this will be revived.

  5. 6 weeks ago

    Done it! :)

    I've been programming in Xojo for about a year and I've kinda left this final obstacle for later.
    Now that my website is almost complete I've spent about a month tinkering with AdSense before I succedeed.

    For starters, new Google's automatic vetting process is flawed. If you submit anything that fires up .cgi you will fail. I should know, I've tried it several times with .cgi, full page frame pages with redirects and whatever else I could think of. Their 3 days waiting period often stretched to 8-10 days. Therefore my attempts were days apart.

    Finally I've decided to game the system. I've placed a flat html index page with some semi-related content (no cms, links or whatever) and voilla, I was AdSense worthy in a day. Then I've changed the index.html <head> like this:

    <head>
    <meta id="redirect" http-equiv="refresh" content="0; url=http://mydomain/myfolder/myapp.cgi">
    </head>

    And In my Xojo App I use a weblabel (with fixed size else anchored on two points - or else I got smaller adsense unit shown then the desired weblabel size) that opens an iframe (for the ease of testing - this way I could change my adsense related code without recompiling):

    mylabel.text = "<raw><p><iframe frameborder=""0"" width=""250px"" min-height=""600px"" height=""650px"" src=""adse.html""></iframe></p></raw>"

    Notice the relative path - doesnt work without it. My adse.html file is in a a folder where my .cgi app is. If you use hashtags with /# instead of just # frame will not load beacause of relative paths. Also size is vertical beacuse I needed vertical banners for the sides of my website.

    Contens of my adse.html is a gener AdSense generated code:

    <body>
    <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!-- my_ad_unit -->
    <ins class="adsbygoogle"
         style="display:inline-block;width:160px;height:600px"
         data-ad-client="ca-pub-xxx"
         data-ad-slot="xxx"></ins>
    <script>
         (adsbygoogle = window.adsbygoogle || []).push({});
    </script>
    </body>

    I load it in my resized event (Unsure if this is the best way).
    It works nicely, pageviews andimpressions are shown and calculated just as well as on any other website.

    I work on my AdBlock detection now.

    Hope that was clear enough. Good luck, and now that people know it could be done I expect refinements and a better way of doing AdSense.

or Sign Up to reply!