Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

How to use ads in project tiny

Discussion in 'Project Tiny' started by NSWell, Dec 16, 2018.

  1. NSWell

    NSWell

    Joined:
    Jul 30, 2017
    Posts:
    89
    Is there any information about playable ads?
     
  2. Nkon

    Nkon

    Unity Technologies

    Joined:
    Jun 12, 2017
    Posts:
    65
    Hi there!

    Tiny supports creating MRAID compliant playable ads, however the documentation of the PlayableAd module is still in the making.

    Here's a rough outline of the steps required when building playables:
    1. Create the playable experience for the game you wish to advertise.
    2. Create an end card for the playable using UICanvas.
    3. Create a UI element or button that accepts touch input from the user, then add it to the end card.
    4. Set the end card to appear after 30 seconds from launch.
    5. Open <your_projectname>.utproject in the Inspector and fill the store URLs in Configurations > PlayableAdInfo.
    6. If the UI element is clicked during runtime, call ut.PlayableAd.Service.openStore();
    7. Verify that the end card appears correctly after 30 seconds and that clicking the UI element opens the correct store URL.
    It is possible to fast-forward the playable by calling ut.PlayableAd.Service.complete(). This will set the timer of the playable to almost finished. After calling this it is recommended to show the end card right away.

    Remember that the end-user devices can have a wide variety of different screen resolutions / aspect ratios, so we recommend thorough testing for maximum compatibility.

    In addition, we recommend adding Analytics to the playable so that the playable can be optimized later on if needed. Basic analytics events are available from ut.PlayableAd.Analytics, additionally ut.PlayableAd.Service.sendAnalyticsEvent can be used.

    Cheers!
     
    FardinHaque and ER_Dolleman like this.
  3. WellC

    WellC

    Joined:
    Mar 2, 2015
    Posts:
    48
    Thanks Nkon!
    I try it.
     
  4. WellC

    WellC

    Joined:
    Mar 2, 2015
    Posts:
    48
    Hey, NKon.I have tried your solution.But it doesn't work!I added the event
    ut.PlayableAd.Service.openStore();
    to the button and nothing happens when I press the button.
     
  5. Nkon

    Nkon

    Unity Technologies

    Joined:
    Jun 12, 2017
    Posts:
    65
    Hey,

    For openStore() to work, the browser needs to report itself as a mobile device.

    You can use Chrome's Developer Tools to force a desktop browser into mobile device mode. Do this by going View > Developer > Developer Tools. From the sidebar that opens, click on the Toggle Device Toolbar icon. You can then select a specific mobile device model to test how the page would work on that device.

    Here's a helpful page with more info: https://developers.google.com/web/tools/chrome-devtools/device-mode/

    Cheers!
     
  6. NSWell

    NSWell

    Joined:
    Jul 30, 2017
    Posts:
    89
    Yes, it is running my iPhone.But there is no feedback when the button is pressed.

    [LIST=1]
    [*]Verify that the end card appears correctly after 30 seconds and that clicking the UI element opens the correct store URL.
    [/LIST]

    Where can we find the store URL?
     
  7. ullatussimo

    ullatussimo

    Unity Technologies

    Joined:
    Jun 16, 2015
    Posts:
    108
    Hi @NSWell ,

    Thanks for your response!

    You can set the Store URLs in your project configuration.
    You can find the project configuration by finding your Tiny project in your Unity project hierarchy and then clicking the <Project_name>.utproject file.
    Once you enable the UTiny.PlayableAd module, you should find the PlayableAdInfo configuration at the bottom of the inspector window.

    Hope this helps.

    Cheers,
    Simo
     
  8. WellC

    WellC

    Joined:
    Mar 2, 2015
    Posts:
    48
    Thanks. I know how to set up a URL but I want to know where this URL is obtained from?
     
  9. ullatussimo

    ullatussimo

    Unity Technologies

    Joined:
    Jun 16, 2015
    Posts:
    108
    Hi @WellC,

    Thanks for your response!

    You can find your Store URLs as follows:

    iOS:
    1.) Log in to your iTunes Connect account.
    2.) Click My Apps.
    3.) Click on the app in question.
    4.) Click More.
    5.) Click View on App Store.
    You can now copy your Apple App Store URL from your address bar.

    Android:
    You can construct your Store URL as follows:
    http://play.google.com/store/apps/details?id=<package_name>
    So, if your package name is com.examplecompany.exampleapp, the correct URL would be
    http://play.google.com/store/apps/details?id=com.examplecompany.exampleapp

    Hope this helps!

    Kind regards,
    Simo
     
  10. WellC

    WellC

    Joined:
    Mar 2, 2015
    Posts:
    48
    Thanks. I have already got the link.
    This is my code. But there is no feedback when the button is pressed.
    My App url:
    https://itunes.apple.com/us/app/save-partners/id1253386172?l=zh&ls=1&mt=8

    Code (CSharp):
    1.  
    2. namespace game {
    3.  
    4.     /** New System */
    5.     export class PlayableAdsTriggerSystem extends ut.ComponentSystem {
    6.  
    7.         OnUpdate(): void {
    8.             if (ut.Runtime.Input.getMouseButtonDown(0)) {
    9.                 ut.PlayableAd.Service.openStore();
    10.                 alert(ut.PlayableAd.Service.getState());
    11.             }
    12.         }
    13.     }
    14. }
    15.  
     
  11. ullatussimo

    ullatussimo

    Unity Technologies

    Joined:
    Jun 16, 2015
    Posts:
    108
    Hi @WellC ,

    Thanks for your response!

    Curious. The code should open up the store in case the Store URL is set properly.
    I tried the code on my personal test project and it works fine. The store opens when the mouse button is pressed / screen is tapped.

    Can you give a bit more details so we could take a deeper look?
    - By 'But there is no feedback when the button is pressed.' do you mean there is no feedback whatsoever? Do you see the alert box popping up when the mouse button is pressed?
    - You have enabled the UTiny.PlayableAd Module in the Tiny Project configuration, correct?
    - You have set the Store URL to the PlayableAd configuration in the Tiny Project configuration, correct?
    - What environment are you testing this on (desktop / mobile)? Which browser? I did notice that on iOS Safari the store page did not open but the alert box did pop up. On iOS Chrome the store opened as expected.

    Kind regards,
    Simo
     
  12. WellC

    WellC

    Joined:
    Mar 2, 2015
    Posts:
    48
    Thanks,It's work! But I dont know what is the playable ads?
    How to make money?
     
  13. ullatussimo

    ullatussimo

    Unity Technologies

    Joined:
    Jun 16, 2015
    Posts:
    108
    Hi @WellC ,

    Thanks for your response.

    I think there is a little bit of confusion here.
    The PlayableAd module is meant to provide a compatibility API for creating Playable Ads.

    Currently there is no API for showing ads inside the Tiny project.

    Hope this clarifies.

    Kind regards,
    Simo