Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
How to implement Ads plugin into html5? — Gideros Forum

How to implement Ads plugin into html5?

yubaroyubaro Member
edited May 2016 in General questions
Hi guys!...I read the email sent by Nicolas, but I could not implement it for lack of details...Someone managed implementation?..or maybe @hgy29 you could send us an example of how to implement it?

Comments

  • hgy29hgy29 Maintainer
    Hi @yubaro,

    Here is the lua code I used for my tests:
    require("ads")
    ad = Ads.new("adsense")
    ad:addEventListener(Event.AD_INITIALIZED,function()
    	ad:setKey("ca-pub-XXXX", "YYYY")
    	ad:showAd("auto")
    	ad:setX(100)
    end)
     
    ad:addEventListener(Event.AD_RECEIVED,function(evt)
     print("Ad loaded")
    -- ad:showAd(evt.type) (not necessary)
    end)
    Replace ca-pub-XXXX and YYYY by your client ID and ad block ID, as supplied by google.

    Likes: oleg

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.