Advertising and Analytics

These functions are provided for integrating advertising and analytics services.

WARNING! As of the 1.3 update to GameMaker: Studio, these functions are no longer applicable to the Android and iOS target platforms. Instead, please see the section on Extensions as these platforms are now supported through Extension Packages.

There are a number of different companies that offer mechanisms to add advertising to your games, and there are others that permit you to integrate some form of analytics (so that you can see how your game is expanding in the given market place). GameMaker: Studio has a number of functions included as standard to make adding these services a simple matter.

NOTE: This functionality is limited to the Professional Version of GameMaker: Studio.

In Game Advertising

Once you have set up your advertising provider in the Global Game Settings - Advertising Tab, you will need to write them into your game using the following simple functions to control how the adverts are used and displayed:

  1. ads_enable
  2. ads_disable
  3. ads_move
  4. ads_get_display_width
  5. ads_get_display_height

We also support basic interstitial ads from Admob with the following functions:

  1. ads_interstitial_available
  2. ads_interstitial_display

Apart from these basic ads, some ad providers (like Supersonic and AdColony) offer more interactive interstitial ads that can be used to generate virtual currency for the user. However for these ads to function correctly you will need to have set up your own database to record the currencies for each player, which also means you should create your own login system to get the player id, or have some mechanism in place to identify each installation of your game to the database.

When you activate one of these ads it can be an "offerwall" (essentially a page to promote several different advertising campaigns) or a video and when the player watches an ad or clicks on an offer, the ad company calls your callback on the server you have set up to award the currency to the player. Note that it could be 15 minutes after the player has watched the movie (or clicked an offer) or it could be instantaneous so you must have that backend database set up and active 24 hours a day.

NOTE: To retrieve the currency for your player, you will need to use the http_get and http_post_string functions.

The following functions exist for ads from these companies:

  1. ads_setup
  2. ads_engagement_available
  3. ads_engagement_launch
  4. ads_engagement_active

Testing Ads

Certain providers provide the possibility to test ads on your device before you actually finalize their use and so GameMaker: Studio includes the option to switch testing on in the Global Game Settings - Advertising Tab. This option will affect your app differently depending on the target platform and the provider selected.

Android

On Android devices when testing is active, all ads will be displayed with a blue background that permits you to see what position and area is being used for the ad as well as see how well the test ads fit the specified ad space. Not all ad providers permit ad testing so below is a brief summary of those that do and how to set them up:

iOS

iOS ad testing is limited to only a few companies currently and these are listed below along with instructions on how to set them up:

HTML5

Currently the support for testing ads on HTML5 has to be configured through the control panel of your developer account with the chosen company, with the "Test Ads" option in the Global Game Settings doing nothing at the moment. It is simply provided to make integrating future advertising partners easier.

PlayHaven

PlayHaven is a content provider for iOS and Android that permits you to show interstitial ads with a wide variety of content available - cross promotion of games, paid ads, user data requests and a lot more besides. Accessing all this functionality can be achieved via a very few function calls from within GameMaker: Studio, but to get them to work correctly you will have to have created a PlayHaven account and set up content to be displayed.

Further information on PlayHaven setup and integration can be found on the YoYo Games Knowledge Base.

The following functions can be used in your games to access PlayHaven content:

  1. ads_event
  2. ads_event_preload
  3. ads_set_reward_callback
  4. playhaven_add_notification_badge
  5. playhaven_hide_notification_badge
  6. playhaven_position_notification_badge
  7. playhaven_update_notification_badge

Analytics

WARNING! As of the 1.4 update to GameMaker: Studio, these functions are no longer applicable to the Android and iOS target platforms. Instead, please see the section on Extensions as these platforms are now supported through Extension Packages.

Your game can be tracked by different Analytics providers (principally Flurry and Google Analytics) which can be set up in the special Global Game Settings - Analytics Tab. In general, the analytics are autonomous, with each provider tracking the product and making the information available through their own web pages, but there are two extra functions supplied by GameMaker: Studio to permit you to send a text event to the analytics provider which you can then use to track special features from within your game:

  1. analytics_event
  2. analytics_event_ext


Back: Reference
© Copyright YoYo Games Ltd. 2018 All Rights Reserved