Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gdevelop5:all-features:admob [2019/06/13 14:15]
piyushpalawat99
gdevelop5:all-features:admob [2019/08/17 07:18] (current)
4ian [Setting up your game]
Line 1: Line 1:
-# AdMob+Integrating ads using Google ​AdMob
  
 GDevelop supports integrating ads into your game using **Google AdMob**, on *Android* and *iOS*. ​ GDevelop supports integrating ads into your game using **Google AdMob**, on *Android* and *iOS*. ​
  
-Ads can be loaded and displayed in your game at any time. They can then be displayed as a  ​**banner** at the top or bottom of the screen or they can be displayed as **interstitial screens**.  ​Interstitial screens ​are ads that cover the entire ​device ​screen. ​You can also display ​**reward ​videos**.+Ads can be loaded and displayed in your game at any time. They can be displayed as **banners** at the top or bottom of the screenor displayed as **interstitial screens**.  ​_Interstitial screens_ ​are ads that cover the entire screen. **Reward ​videos** ​can also be displayed.
  
-Banner ads are usually displayed during ​the gameplay, while interstitial ​screens and reward videos are displayed after the completion of a level or objective.+Banner ads are usually displayed during gameplay. Interstitial ​screens and reward videos are displayed after the completion of a level or an objective.
  
-## 1) Setting up your Google AdMob account+## Setting up your Google AdMob account
  
 To get started, go to [[https://​www.google.com/​admob/​|AdMob website]] and create an account. Once that is done, you can create a new app and an ad unit. To get started, go to [[https://​www.google.com/​admob/​|AdMob website]] and create an account. Once that is done, you can create a new app and an ad unit.
  
-Click on ''​Apps"​ then "Add App" in the left menu":+  * Click on ''​Apps"​ then "Add App" in the left menu".
  
 {{ :​gdevelop5:​all-features:​admob-left-menu-add-app.png?​nolink |}} {{ :​gdevelop5:​all-features:​admob-left-menu-add-app.png?​nolink |}}
  
-Then, add your application by entering its name and choosing its platform. If your game is for both iOS and Android, you must register two ad units.+* Add your application by entering its name and choosing its platform. If your game is for both iOS and Android, you must register two ad units.
  
-When created, ​you can see your **app id** being displayed. You can note it now, but it will also be shown again at a later time in the process:+When created, your **app id** will be displayed.
  
 {{ :​gdevelop5:​all-features:​admob-app-created.png?​nolink |}} {{ :​gdevelop5:​all-features:​admob-app-created.png?​nolink |}}
  
-Next, choose ​whether you want to create ​the ad unit to display ​a banner, an interstitial screen or a reward video:+Next, choose ​if the ad unit will be a banner, an interstitial screen or a reward video.
  
 {{ :​gdevelop5:​all-features:​admob-choose-ads-type.png?​nolink |}} {{ :​gdevelop5:​all-features:​admob-choose-ads-type.png?​nolink |}}
  
-Here, for example, we chose "​Banner"​. We then enter the name for this ad unit and click on "​Create Ad Unit":+* Enter the name for this ad unit and click on "​Create Ad Unit".
  
 {{ :​gdevelop5:​all-features:​admob-banner-setup.png?​nolink |}} {{ :​gdevelop5:​all-features:​admob-banner-setup.png?​nolink |}}
  
-When you are finished, be sure to take note of the app id and the ad unit identifier:+* You will now see the app id and the ad unit identifier.
  
 {{ :​gdevelop5:​all-features:​admob-adunit-id.png?​nolink |}} {{ :​gdevelop5:​all-features:​admob-adunit-id.png?​nolink |}}
  
-The first identifier is the **app id**. The second is the **ad unit identifier**. ​Copy these identifiers ​or keep the page opened, you will need to insert them in the game properties and actions parameters to display the ads.+<note important>​The first identifier is the **app id**. The second is the **ad unit identifier**. ​You need to know these identifiers to insert them in the game properties and actions parameters to display the ads. Copy them or leave the screen open. </​note>​ 
 +## Setup Payments in Admob
  
-## 2) Set up your game +Before your ads can be displayed, you need to set up the payment method in your account. Go to the Payments page and fill in the necessary information:​
  
-Once you have created your AdMob account and have the ad unit identifier, open your game properties. Open the Project Manager, then click on Game settings and Properties.+{{ :​gdevelop5:​all-features:​admob-payments-menu.png?nolink |}}
  
-At the bottompaste the **app id**:+When your account is readyAdmob will tell you so by showing that your account is *approved*:
  
-{{ :​gdevelop5:​all-features:​admob-identifier.png?nolink |}}+{{ :​gdevelop5:​all-features:​admob-account-approved.png?nolink |}}
  
-<note important>​Try not to be confused between the *app id* and the *ad unit identifier*. Here you need to enter the app id, which is unique for your app, while ad unit identifiers are different for each ad you're creating.</​note>​+Ads should now be able to be shown.
  
 +<note warning>​It can take a few hours (~4) for ads to show the first time. If ads are not showing, double check that you've entered all the necessary information in this page and that you properly configured your game (see next section).</​note>​
 +
 +## Setting up your game 
 +
 +* Once you have created your AdMob account and have the app id and the ad unit identifier, open your game properties. Open the Project Manager, then click on Game settings and Properties.
 +
 +* At the bottom, enter your **app id**.
 <note warning>​The app id must be entered *without* quotes.</​note>​ <note warning>​The app id must be entered *without* quotes.</​note>​
  
-## 3) Use actions to load and display banner/​interstitial screen/​reward video+{{ :​gdevelop5:​all-features:​admob-identifier.png?​nolink |}} 
 + 
 +<note important>​Do not confuse the *app id* and the *ad unit identifier*. The app id is the unique id for your app, while ad unit identifiers are different for each ad you're creating.</​note>​ 
 + 
 +## Loading ​and displaying ads
  
-Once you have your game set up with the *app id*, you can add an event with an action to show the ad unit that you've created. All actions can be found inside the AdMob category:+Once your game is set up with the *app id*, you can add an event with an action to show the ad unit that you've created. All actions can be found inside the AdMob category:
  
 {{ :​gdevelop5:​all-features:​admob-actions.png?​nolink |}} {{ :​gdevelop5:​all-features:​admob-actions.png?​nolink |}}
  
-**You must choose ​the action adapted to your ad unit**If you created a banner, ​you have to use the action to load a banner. ​+Choose ​the action adapted to your ad unit. For example, if you created a banner, use the action to load a banner. ​
  
-In the action, paste the **ad unit id** in the parameters. ​**As parameters are string expressions,​ you must put the ad unit identifier between quotes**For example:+In the action, paste the **ad unit id** in the parameters. ​Because ​parameters are string expressions,​ you must put the ad unit identifier between quotes.
  
 {{ :​gdevelop5:​all-features:​admob-app-banner-id-action.png?​nolink |}} {{ :​gdevelop5:​all-features:​admob-app-banner-id-action.png?​nolink |}}
  
-Here is an example ​for banner:+For example:
  
 {{ :​gdevelop5:​all-features:​admob-setup-banner-display-action.png?​nolink |}} {{ :​gdevelop5:​all-features:​admob-setup-banner-display-action.png?​nolink |}}
  
-Don't forget to set "​**Display on Load complete**"​ to '​Yes'​, to have the ad displayed as soon as it is ready+To display the ad as soon as it is ready, ​set "​**Display on Load complete**"​ to '​Yes'​. 
-You should start by setting ​"​**Test Mode**"​ to '​Yes'​, to test your ads before publishing your game.+To test your ads before publishing your game, set "​**Test Mode**"​ to '​Yes'​.
  
-## 4) Test and publish ​your game on Android (or iOS)+## Testing ​and publishing ​your game on Android (or iOS)
  
-You must first build your game for Android (or iOS) to have the ads displayed on the device. ​Learn more about it on **[[gdevelop5:​publishing:​android_and_ios|the page about Android and iOS publishing]]**.+You must first build your game for Android (or iOS) to have the ads displayed on the device. ​See **[[gdevelop5:​publishing:​android_and_ios|the page about Android and iOS publishing]]**.
  
 {{ :​gdevelop5:​all-features:​export-android.png?​nolink |}} {{ :​gdevelop5:​all-features:​export-android.png?​nolink |}}
  
-The one-click packaging for Android service included with GDevelop is compatible with Admob, so you don't need any special ​tooling or development ​kit to install.+The one-click packaging for Android service included with GDevelop is compatible with Admob, so no additional ​tooling or development ​kits are needed. 
 + 
 +<​note>​It may take a few days for the Admob service to provide ads to appear in your application,​ especially video content.</​note>​
  
-<note important>​It may take a few days for ads to appear ​in your applicationas the Admob service takes some time to provide video content ​in particular.</​note>​+<note important>​Ads are not visible ​in previewonly in .apk</​note>​
  
-#Example+## Example
  
-You can try the ads and see how they work in a game by opening the example called **AdMob**. ​You can replace ​the app id and the ad unit identifiers in the actions to test with your own account.+See how the ads work in a game by opening the example called **AdMob**. ​Replace ​the app id and the ad unit identifiers in the actions to test with your own account.
  
 <note tip>Try it online! Click **[[https://​editor.gdevelop-app.com/?​project=example://​admob|here to open the Admob example]]**. You must export to Android using the desktop app to test it on a real phone.</​note>​ <note tip>Try it online! Click **[[https://​editor.gdevelop-app.com/?​project=example://​admob|here to open the Admob example]]**. You must export to Android using the desktop app to test it on a real phone.</​note>​